Argusoft interview question

must solve puzzles from geeksforgeeks