top of page
Search
Pascal Triangle Interviewbit Solution
Given numRows, generate the first numRows of Pascal’s triangle.
Pascal’s triangle : To generate A[C] in row R, sum up A’[C] and A’[C-1] from
Spiral Order Matrix II Interviewbit Solution
Given an integer A, generate a square matrix filled with elements from 1 to A2 in spiral order.
Repeat and Missing Number Array Interviewbit Solution
You are given a read only array of n integers from 1 to n.
Each integer appears exactly once except A which appears twice and B which is mis
Max Distance Interviewbit Solution
Given an array A of integers, find the maximum of j - i subjected to the constraint of A[i] <= A[j].
Maximum Unsorted Subarray Interviewbit Solution
You are given an array (zero indexed) of N non-negative integers, A0, A1 ,…, AN-1.
Find the minimum sub array Al, Al+1 ,…, Ar so if we sort(
Wave Array Interviewbit Solution
Given an array of integers, sort the array into a wave like array and return it,
In other words, arrange the elements into a sequence such t
First Missing Integer Interviewbit Solution
Given an unsorted integer array, find the first missing positive integer.
Example:
Given [1,2,0] return 3,
[3,4,-1,1] return 2,
[-8, -7, -6
Set Matrix Zeros Interviewbit Solution
Given a matrix, A of size M x N of 0s and 1s. If an element is 0, set its entire row and column to 0.
Note: This will be evaluated on the e
Find Duplicate in Array Interviewbit Solution
Given a read only array of n + 1 integers between 1 and n, find one number that repeats in linear time using less than O(n) space and traver
Merge Overlapping Intervals
Given a collection of intervals, merge all overlapping intervals.
For example:
Given [1,3],[2,6],[8,10],[15,18],
return [1,6],[8,10],[15,18
bottom of page