Category: algorithms
Given a 2D Grid with integer values representing the colours, you are asked (in an interview probably) to find out the maximum connected colour sizes. A colour is connected …
Given a 2D grid of size n * m and an integer k. You need to shift the grid k times. In one shift operation: Element at grid becomes …
Given a list of directory info including directory path, and all the files with contents in this directory, you need to find out all the groups of duplicate files …
The C++ method iota (not to be confused with itoa which is to convert integers to string), is defined in header numeric. Its purpose is to compute increasing values …
Given a binary tree and a sum, find all root-to-leaf paths where each path’s sum equals the given sum. Note: A leaf is a node with no children. Example: …