Nvest Solution Interview Question

Basic Logical Question from Geeksforgeeks