Company: Ixigo_2Dec
Difficulty: medium
Word Puzzle Word Puzzle Problem Statement You have to solve a puzzle. You are given an N x N grid. It contains lowercase letters from 'a' to 'z' randomly. You can go in any vertical or horizontal direction. Your task is to find whether a given word is present or not. You will be given a number n that contains the number of rows and columns of the grid, followed by a word that you need to find. Then the next n lines contain n characters without any spaces, representing the rows of the grid. If the word can be found, output "yes" followed by a space and the concatenation of all character locations as a single string. If not, then output "no". The locations should be represented by their 1-indexed row and column numbers. Example Input 3 apple ppe lad ebz Output yes 2212112131 Explanation The grid is as follows (represented in uppercase for clarity): P P E L A D E B Z The word "apple" can be found by following this path: a(2,2) -> p(1,2) -> p(1,1) -> l(2,1) -> e(3,1) The output string will