Longest Common Prefix InterviewBit Solution

Problem Description:
Given the array of strings A,
you need to find the longest string S which is the prefix of ALL the strings in the arra

top of page

Search

Longest Common Prefix InterviewBit Solution

Problem Description:
Given the array of strings A,
you need to find the longest string S which is the prefix of ALL the strings in the arra

Median of Array InterviewBit Solution

There are two sorted arrays A and B of size m and n respectively.
Find the median of the two sorted arrays ( The median of the array formed

Rotated Sorted Array Search InterviewBit Solution

Given an array of integers A of size N and an integer B.
array A is rotated at some pivot unknown to you beforehand.
(i.e., 0 1 2 4 5 6 7 mi

Implement Power Function InterviewBit Solution

Implement pow(x, n) % d.
Note that remainders on division cannot be negative.
In other words, make sure the answer you return is non-negati

Search for a Range InterviewBit Solution

Given a sorted array of integers A(0 based index) of size N, find the starting and ending position of a given integer B in array A.
Your alg

Allocate Books InterviewBit Solution

Given an array of integers A of size N and an integer B.
College library has N bags, the ith book has A[i] number of pages.
You have to allo

Painter's Partition Problem InterviewBit Solution

Given 2 integers A and B and an array of integers C of size N.
Element C[i] represents the length of the ith board.
You have to paint all N

Greatest Common Divisor InterviewBit Solution

Given 2 non-negative integers m and n, find gcd(m, n)
GCD of 2 integers m and n is defined as the greatest integer g such that g is a diviso

Grid Unique Paths InterviewBit Solution

A robot is located at the top-left corner of an A x B grid.
The robot can only move either down or right at any point in time. The robot is

Sum of pairwise Hamming Distance InterviewBit Solution

Hamming distance between two non-negative integers is defined as the number of positions at which the corresponding bits are different.

bottom of page