Find largest divisible subset in array
Find the largest divisible subset in a given array. A subset is divisible if for every pair (x, y) in the subset, either x divides y or y divides x.
Find a sequence of moves for a knight on an 8 x 8 chessboard that visits every square exactly once.
Permutations of a given string
Print all permutations of a given string.
Imagine a rat trapped in a maze represented by an N x N grid. Each cell in the grid is either: open represented by the value 1 allowing the rat to move through, or blocked represented by the value 0 preventing the rat from entering. The rat starts at the top-left corner (0, 0) and aims to reach the bottom-right corner (N-1, N-1). Determine all possible paths the rat can take to reach the destination. The rat can move in four directions: Up (U), Down (D), Left (L) and Right (R). Return a list of all possible paths, represented as strings of directions (e.g., "DDRLRRUUDD"). The paths should be sorted in lexicographical order.