Company: Flipkart
Difficulty: medium
Binary Treasure Hunt TeamId: 25849727 You are developing a game where players must find the hidden binary treasures within a grid of size N x N. The grid is composed of characters \'0\' and \'1\', which can be combined to form binary numbers. Players need to search for these binary numbers within the grid based on a given list. The numbers can be formed by connecting adjacent cells either horizontally or vertically, and each cell can be used only once per number. Given a list of decimal numbers and a grid containing \'0\'s and \'1\'s: Convert each decimal number to its binary representation. Check if each binary number can be found in the grid by connecting adjacent cells horizontally or vertically. Each cell can be used only once per number. Output a sequence of \'1\'s and \'0\'s, where each integer indicates whether the corresponding binary number from the list is present in the grid (\'1\' means the number is found, \'0\' means it is not). Special Cases If the grid contains any char