Home
Gaurav's GitHub Page
Cancel

Next Greater Element III

Problem Description Given a positive integer n, find the smallest integer which has exactly the same digits existing in the integer n and is greater in value than n. If no such positive integer ex...

Next Greater Element II

Problem Description Given a circular integer array nums (i.e., the next element of nums[nums.length - 1] is nums[0]), return the next greater number for every element in nums. The next greater num...

Next Greater Element I

Problem Description The next greater element of some element x in an array is the first greater element that is to the right of x in the same array. You are given two distinct 0-indexed integer ar...

Search a 2D Matrix II

Problem Description Write an efficient algorithm that searches for a value target in an m x n integer matrix matrix. This matrix has the following properties: Integers in each row are sorted i...

Search a 2D Matrix

Problem Description Write an efficient algorithm that searches for a value target in an m x n integer matrix matrix. This matrix has the following properties: Integers in each row are sorted f...

Permutation in String

This question is part of NeetCode150 series. PROBLEM DESCRIPTION Given two strings s1 and s2, return true if s2 contains a permutation of s1, or false otherwise. In other words, return true if on...

Longest Repeating Character Replacement

This question is part of NeetCode150 series. Problem Description You are given a string s and an integer k. You can choose any character of the string and change it to any other uppercase English...

All Subsets

This question is part of NeetCode150 series. Problem Description Given an integer array nums of unique elements, return all possible subsets (the power set). The solution set must not contain dup...

All Subsets II

Problem Description Given a set of distinct integers A, return all possible subsets. NOTE: Elements in a subset must be in non-descending order. The solution set must not contain duplicate ...

Longest Substring Without Repeating Characters

This question is part of NeetCode150 series. Problem Description Given a string s, find the length of the longest substring without repeating characters. leetcode Solution This can be solved u...