Given a matrix where every cell represents points. How to collect maximum points using two traversals under following conditions?
Given two strings str1 and str2, find the shortest string that has both str1 and str2 as subsequences.
Given a number x, find sum of digits in all numbers from 1 to n. Examples:
Given an input number of sections and each section has 2 plots on either sides of the road. Find all possible ways to construct buildings… Read More »
In a daily share trading, a buyer buys shares in the morning and sells it on same day. If the trader is allowed to make… Read More »
This is a famous interview question asked in Google, Paytm and many other company interviews. Below is the problem statement.
There are N stations on route of a train. The train goes from station 0 to N-1. The ticket cost for all pair of stations… Read More »
A vertex cover of an undirected graph is a subset of its vertices such that for every edge (u, v) of the graph, either ‘u’… Read More »
Consider a game where a player can score 3 or 5 or 10 points in a move. Given a total score n, find number of… Read More »
Given N jobs where every job is represented by following three elements of it. Start Time Finish Time Profit or Value Associated Find the maximum… Read More »
Given a string ‘str’ of digits, find length of the longest substring of ‘str’, such that the length of the substring is 2k digits and… Read More »
A triangulation of a convex polygon is formed by drawing diagonals between non-adjacent vertices (corners) such that the diagonals never intersect.
Given the mobile numeric keypad. You can only press buttons that are up, left, right or down to the current button. You are not allowed… Read More »
Given a directed and two vertices ‘u’ and ‘v’ in it, find shortest path from ‘u’ to ‘v’ with exactly k edges on the path.
Given a directed graph and two vertices ‘u’ and ‘v’ in it, count all possible walks from ‘u’ to ‘v’ with exactly k edges on… Read More »