Given a ‘N*N’ 2d matrix consisting of positive integers, the task is to find the probability of collecting maximum points by moving either up(from {i,j} to {i+1,j}) or right (from {i,j} to Read more →
Dynamic Programming
19 postsGiven a number N, the task is to find Nth Fibonacci number. The Fibonacci numbers are the numbers in the following integer series. 0, 1, 1, 2, 3, 5, 8, 13, 21, 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 →
Given a Rooted Tree with n node, labeled from 1 to n and tree is rooted at node 1. Parent of i-th node is p[i], i is starting from 2 as 1 Read more →
Given an array of unique integers, print the array in such a way that the first element is first maximum and second element is first minimum and so on. We have to Read more →
Given an array of N integers, where each value represents the volume of the cloud. The task is to choose the two highest volume clouds from an array and smash them together. Read more →
Given two array A[] and B[] of length N, the task is the find the minimum cost to make array A[] a permutation of array B[], where the cost of incrementing or Read more →
N objects are placed on X-axis, and coordinates are given. Starting your journey with coordinate 0, find minimum distance you need to travel to collect K objects (If multiple objects are placed Read more →
Given an array of positive integers, find the maximum product difference. The product difference between the two pairs is defined as taking the product of two pairs, followed by taking their difference. Read more →
You are given an binary array (i.e., containing 0 and 1 as a element). Here, 0 means a straight path and 1 means zigzag path. Add one to score when zero appears Read more →