Home
Gaurav's GitHub Page
Cancel

IPO

PROBLEM DESCRIPTION Suppose LeetCode will start its IPO soon. In order to sell a good price of its shares to Venture Capital, LeetCode would like to work on some projects to increase its capital b...

Max Points on a Line

PROBLEM DESCRIPTION Given an array of points where points[i] = [xi, yi] represents a point on the X-Y plane, return the maximum number of points that lie on the same straight line. leetcode SOLUT...

Construct Quad Tree

PROBLEM DESCRIPTION Given a n * n matrix grid of 0’s and 1’s only. We want to represent grid with a Quad-Tree. Return the root of the Quad-Tree representing grid. A Quad-Tree is a tree data struc...

Maximal Square

PROBLEM DESCRIPTION Given an m x n binary matrix filled with 0’s and 1’s, find the largest square containing only 1’s and return its area. leetcode SOLUTION Neetcode YouTube class Solution { ...

Minimum Path Sum

PROBLEM DESCRIPTION Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right, which minimizes the sum of all numbers along its path. Note: You can only move e...

Furthest Point From Origin

Problem Description You are given a string moves of length n consisting only of characters ‘L’, ‘R’, and ‘_’. The string represents your movement on a number line starting from the origin 0. In t...

Maximum Sum Circular Subarray

PROBLEM DESCRIPTION Given a circular integer array nums of length n, return the maximum possible sum of a non-empty subarray of nums. A circular array means the end of the array connects to the b...

Find K Pairs with Smallest Sums

PROBLEM DESCRIPTION You are given two integer arrays nums1 and nums2 sorted in non-decreasing order and an integer k. Define a pair (u, v) which consists of one element from the first array and on...

Sort List

PROBLEM DESCRIPTION Given an integer array nums where the elements are sorted in ascending order, convert it to a height-balanced binary search tree. leetcode SOLUTION First we get the center of...

Convert Sorted Array to Binary Search Tree

PROBLEM DESCRIPTION Given an integer array nums where the elements are sorted in ascending order, convert it to a height-balanced binary search tree. leetcode SOLUTION We can solve this recursiv...