Skip to content

Category Archives: Dynamic Programming

Given an integer N, the task is to print all possible Full Binary Trees with N nodes. The value at the nodes does not contribute… Read More
Given a matrix mat[][] of size N×M where each row of the matrix is a permutation of the elements from [1, M], the task is… Read More
Given a positive integer N, the task is to count the number of N-digit numbers where each digit in the number is the mean of… Read More
Given a positive integer N, the task is to count the number of N-digit numbers such that the bitwise AND of adjacent digits equals 0.… Read More
Given a complete graph having N nodes and N*(N-1)/2 edges and a positive integer K, the task is to find the number of ways if… Read More
Given a string S, the task is to find the length of the shortest compressed string. The string can be compressed in the following way:… Read More
Given an array arr[] of N integers and an integer K. The task is to find the number of subarrays with a maximum value is… Read More
Given two arrays A[] and B[] each of size N, the task is to find the maximum sum that can be obtained based on the… Read More
Given a positive integer N, the task is to count the number of N-digit numbers such that every digit from [0-9] occurs at least once.… Read More
Given three non-negative integers, X, Y, and K, the task is to find the Kth smallest lexicographical string having X occurrences of character ‘a’ and… Read More
Given two positive integers N and L, the task is to find the number of L-length arrays made up of first N natural numbers such… Read More
Rahul and Ankit are the only two waiters in the Royal Restaurant. Today, the restaurant received N orders. The amount of tips may differ when… Read More

Start Your Coding Journey Now!