Sam is given a rectangular paper having dimensions h*w, where h is the height and w is the width. Sam wants to fold the paper so its dimensions are...
Charlie wants to divide a big piece of waffle which is made up of m*n square pieces. Each piece is of size 1*1. The shape of waffle is a...
You are given a string that is formed from only three characters ‘a’, ‘b’, ‘c’. You are allowed to change atmost ‘k’ characters in the given string while attempting...
In Hackerland every character has a weight. The weight of an English uppercase alphabet A-Z is given below : A = 1 B = 2*A + A C =...
Dia, Sam, and Robert are the three students of a same class. You know their marks in ‘N’ subjects. Your job is to find their ranks according to their...
Given a string, count all distinct substrings of the given string. Example Input abcd Output 10 All Elements are Distinct Input aaa Output 6
Given a tree with N nodes we are required to seperate a connected component with exactly k nodes. You are given queries specifying this k. We need to find...
Consider an array A. Your job is to find longest subarray in which elements greater than x are more than elements not greater than x Input 1. size of...
Find the total number of ways a m×n board can be painted using 3 colors while making sure no cells of the same row or the same column have...
A rotation on a string is defined as removing first element and concatenating it at the end. Given N and an array of N strings.Your job is to predict...