Home
Gaurav's GitHub Page
Cancel

Min Steps in Infinite Grid (Interviewbit)

PROBLEM DESCRIPTION You are in an infinite 2D grid where you can move in any of the 8 directions (we can move diagonally as well) You are given a sequence of points and the order in which you nee...

Pick from both sides (Interviewbit)

PROBLEM DESCRIPTION Given an integer array A of size N. You have to pick exactly B elements from either left or right end of the array A to get the maximum sum. Find and return this maximum possib...

Occurence of Each Number (InterviewBit)

PROBLEM DESCRIPTION You are given an integer array A. You have to find the number of occurences of each number. Return an array containing only the occurences with the smallest value’s occurence f...

Getting Started With Spring

🌱 Spring Framework - 101 🌱 If you are looking for a comprehensive and easy-to-follow guide to learn the Spring Framework, you have come to the right place. This blog page covers a wide range of to...

Binary Tree Longest Consecutive Sequence

PROBLEM DESCRIPTION Given the root of a binary tree, return the length of the longest consecutive sequence path. A consecutive sequence path is a path where the values increase by one along the pa...

Find the Celebrity

PROBLEM DESCRIPTION Suppose you are at a party with n people labeled from 0 to n - 1 and among them, there may exist one celebrity. The definition of a celebrity is that all the other n - 1 people...

Find Permutation

PROBLEM DESCRIPTION A permutation perm of n integers of all the integers in the range [1, n] can be represented as a string s of length n - 1 where: s[i] == 'I' if perm[i] < perm[i + 1], an...

Missing Number In Arithmetic Progression

PROBLEM DESCRIPTION In some array arr, the values were in arithmetic progression: the values arr[i + 1] - arr[i] are all equal for every 0 <= i < arr.length - 1. A value from arr was removed...

First Unique Number

PROBLEM DESCRIPTION You have a queue of integers, you need to retrieve the first unique integer in the queue. Implement the FirstUnique class: FirstUnique(int[] nums) Initializes the object w...

Delete N Nodes After M Nodes of a Linked List

PROBLEM DESCRIPTION You are given the head of a linked list and two integers m and n. Traverse the linked list and remove some nodes in the following way: Start with the head as the current n...