Given a list of elements p, the task is to convert the whole list into a list of sets. Examples: Input: p = ['apple', 'banana', 'cherry'] Output: [{‘apple’}, {‘banana’}, {‘cherry’}] Explanation : ...read more
We have to create an inverse triangle in the form of numbers (decreasing order). Example: If the user provide 5. The print 5, 5 times ; 4, 4 times and so on. ...read more
Given a number N, the task is to print all duplicate digits of that number in sorted order. Examples: Input: 123412989 Output : 3 4 8 Explanation : The unique digits are ...read more
Dynamic Programming is an algorithmic approach to solve some complex problems easily and save time and number of comparisons by storing the results of past computations. The basic idea of dynamic programming ...read more
Amanada, a school kid, is learning English alphabets. Her teacher devised a small game to make the task fun. A grid of ‘m’ rows and ‘n’ columns is filled with English alphabets. ...read more
There is question that what should we use void main() or int main() ? void main() { /* ... */ } Or, int main() { /* ... */ } In both language ...read more
Given a binary tree and two nodes a and b, the task is to print the maximum node value that lies in the path connecting the nodes a and b. If either ...read more
Backtracking is an algorithm that searches for possible combinations in order to solve computational problems. It is used for solving problems recursively by building increments and removing solutions that do not satisfy ...read more
In a prison, there are N cells. The positions of the cells are given in an array. The Jailer has to place all the prisoners in the cells in an ordered manner ...read more
Data is information collected for various purposes. Data is information, facts, or details. It can be numbers, words, and images. Data can be raw and processed and are often used for analysis, ...read more