Find the maximum length snake sequence in a matrix.
Solve the Coin Change problem using Dynamic Programming.
Determine whether a given instance of the 15-puzzle is solvable.
Find the maximum size sub-matrix with all 1s in a given binary matrix.
Find the minimum number of jumps required to reach the end of an array.
Perform insertion at the head and middle of a doubly circular linked list.
Unique Paths II – Find the number of unique paths in a grid with obstacles
Implement the Trapping Rain Water problem using a dynamic programming approach.
Solve the coin change problem: find the number of ways to make a given sum using given coins.
Decode a string of digits where 'A' = 1, 'B' = 2, ..., 'Z' = 26. Return the total number of ways to decode it.
Given an unweighted bidirectional graph, count the number of neighbors that are at a maximum distance of 2 edges from a given source node.
Given a number N, count the number of permutations of numbers from 1 to N such that all prime indices (1-based indexing) contain only prime numbers.
Find the size of the largest triangular subsequence in an array of integers, where every triplet in the subsequence satisfies the triangle inequality.
Find the shortest distance from a source cell to any edge cell in a grid, where 0 represents a traversable cell, 1 represents a blocked cell, and 2 represents the source.
Given an M x N matrix containing '*' (mines) and '.' (empty), output a matrix where each non-mine cell contains the count of adjacent mines (up to 8 directions), and mine cells remain '*'.
Given multiple strings, two strings are related if they are of the same size and differ by exactly one character. The relation is transitive. Print groups of strings that are related to each other.
Given two integer arrays A and B of sizes m and n, find the sum of all elements present at k points distance from each other. Check if this sum can be represented as the sum of k prime numbers. If yes, print the union of the two arrays; otherwise, print their intersection.
Write pseudocode for solving the Knight’s Tour problem.
Write an algorithm to implement Quicksort on a doubly linked list and explain it.
Optimize the coin query problem using preprocessing or data structures to improve runtime over the brute-force approach.
Given two strings S1 and S2, convert S1 into a palindrome by replacing characters such that S1 contains S2, using the minimum number of steps. Return -1 if not possible.
Given two strings S1 and S2, convert S1 into a palindrome by replacing characters such that S1 contains S2 as a substring in the minimum number of steps. Return -1 if not possible.
Given a building where from floor A you can move to floor A/p where p is a prime factor of A smaller than M, find the minimum time for two people starting at floors X and Y to meet on any floor.
Given a string consisting of characters 'a'-'z', space, colon ':', smiley ':)', frowny ':(', and brackets '(' and ')', determine whether the string is balanced parenthesized based on the given rules.
Given N strings, find all the connected chains where two strings are directly connected if they are of the same length and differ in exactly one alphabet. Connections are transitive. Print all possible chains in input order.
Given N coins arranged in a row and Q queries, where each query specifies X and Y, compute either the sum or product of all special coins in the interval [X, N]. A coin is special if the distance between its index and any other special coin is divisible by Y.