Given a paper of size A x B, the task is to cut the paper into squares of any size. Find the minimum number of squares that can be cut from the paper.
Example:
When paper size is 36 x 30, the outpu ...
Given a string, the task is to return the length of its longest possible chunked palindrome. It means a palindrome formed by substrings. For better understanding, look at the examples below.
Example ...
Given a string of characters of length less than 10, return all the alpha-numeric abbreviations of the string (in lexicographic order).
The alpha-numeric abbreviation is in the form of characters mi ...
Given two sequences A and B, find out number of unique ways to transform sequence A into sequence B. Transformation means converting string A (by removing 0 or more characters) to string B.
Examples ...
Given an array of length n + 1, containing elements 1..n and a special character 999 , write a function that sorts the array using only swaps with the special character. In other words, you can only ...
Given lists N and R, video names and their watch rates, write a function that will return the videos with the top 10 watch rates. Video names may appear more than once.
Example:
N = ["abc", "def", ...
Given a string A consisting of n characters and a string B consisting of m characters, write a function that will return the number of times A must be stated such that B is a substring of the repeate ...
We have to paint n boards of length [A1, A2, ..., An]. There are k painters available and each takes 1 unit time to paint 1 unit of board. The problem is to find the minimum time to get this job done ...
Problem
Given an integer, write a function to determine if it is a power of 2. And return a boolean which is True or False.
Example
Given 128,
128 is 2^7 So, that must return True.
Problem
Given a string containing only digits, restore it by returning all possible valid IP address combinations.
Example
Given "25525522235",
return ["255.255.222.35", "255.255.22.235"]. (Orde ...