Home
Gaurav's GitHub Page
Cancel

Sorted Insert Position (InterviewBit)

PROBLEM DESCRIPTION Given a sorted array A and a target value B, return the index if the target is found. If not, return the index where it would be if it were inserted in order. You may assume n...

Smaller or equal elements (InterviewBit)

PROBLEM DESCRIPTION Given an sorted array A of size N. Find number of elements which are less than or equal to B. NOTE: Expected Time Complexity O(log N) SOLUTION public class Solution { p...

PRETTYPRINT (InterviewBit)

PROBLEM DESCRIPTION Print concentric rectangular pattern in a 2d matrix. Let us show you some examples to clarify what we mean. Example 1: Input: A = 4. Output: 4 4 4 4 4 4 4 4 3 3 3 3 3 4 4 ...

Divisible by 60 (InterviewBit)

PROBLEM DESCRIPTION Given a large number represent in the form of an integer array A, where each element is a digit. You have to find whether there exists any permutation of the array A such that ...

Excel Column Number (InterviewBit)

PROBLEM DESCRIPTION Given a column title A as appears in an Excel sheet, return its corresponding column number. SOLUTION public class Solution { public int titleToNumber(String A) { ...

Reverse integer (InterviewBit)

PROBLEM DESCRIPTION You are given an integer N and the task is to reverse the digits of the given integer. Return 0 if the result overflows and does not fit in a 32 bit signed integer. SOLUTION ...

Palindrome Integer (InterviewBit)

PROBLEM DESCRIPTION Determine whether an integer is a palindrome. Do this without extra space. A palindrome integer is an integer x for which reverse(x) = x where reverse(x) is x with its digit re...

Highest Score (InterviewBit)

PROBLEM DESCRIPTION You are given a 2D string array A of dimensions N x 2, where each row consists of two strings: first is the name of the student, second is their marks. You have to find the max...

Prime Sum (InterviewBit)

PROBLEM DESCRIPTION Given an even number ( greater than 2 ), return two prime numbers whose sum will be equal to the given number. If there is more than one solution possible, return the lexicogra...

Distribute in Circle! (InterviewBit)

PROBLEM DESCRIPTION A items are to be delivered in a circle of size B. Find the position where the Ath item will be delivered if we start from a given position C. NOTE: Items are distributed at ...