Home
Gaurav's GitHub Page
Cancel

Wiggle Sort

PROBLEM DESCRIPTION Given an integer array nums, reorder it such that nums[0] <= nums[1] >= nums[2] <= nums[3]…. You may assume the input array always has a valid answer. leetcode SOLU...

Maximum Distance in Arrays

PROBLEM DESCRIPTION You are given m arrays, where each array is sorted in ascending order. You can pick up two integers from two different arrays (each array picks one) and calculate the distance....

Best Time to Buy and Sell Stock IV

Problem Description You are given an integer array prices where prices[i] is the price of a given stock on the ith day, and an integer k. Find the maximum profit you can achieve. You may complete ...

Best Time to Buy and Sell Stock III

Problem Description You are given an array prices where prices[i] is the price of a given stock on the ith day. Find the maximum profit you can achieve. You may complete at most two transactions. ...

Word Search II

Problem Description Given an m x n board of characters and a list of strings words, return all words on the board. Each word must be constructed from letters of sequentially adjacent cells, where ...

Text Justification

PROBLEM DESCRIPTION Given an array of strings words and a width maxWidth, format the text such that each line has exactly maxWidth characters and is fully (left and right) justified. You should p...

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