Home
Gaurav's GitHub Page
Cancel

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 ...

Total Moves For Bishop! (InterviewBit)

PROBLEM DESCRIPTION Given the position of a Bishop (A, B) on an 8 x 8 chessboard. Your task is to count the total number of squares that can be visited by the Bishop in one move. The position of...

Binary Representation (InterviewBit)

PROBLEM DESCRIPTION Given a number N >= 0, find its representation in binary. Example: if N = 6, binary form = 110 InterviewBit SOLUTION public class Solution { public String findDigit...