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...
Best Time to Buy and Sell Stock
This question is part of NeetCode150 series. Problem Description You are given an array prices where prices[i] is the price of a given stock on the ith day. You want to maximize your profit by c...
Noble Integer
Problem Description Given an integer array A, find if an integer p exists in the array such that the number of integers greater than p in the array equals to p. Solution Let’s say we sort the ar...
Container With Most Water
This question is part of NeetCode150 series. Problem Description You are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the ith line ar...
Two Sum II - Input Array Is Sorted
This question is part of NeetCode150 series. Problem Description Given a 1-indexed array of integers numbers that is already sorted in non-decreasing order, find two numbers such that they add up...
Valid Palindrome
This question is part of NeetCode150 series. Problem Description A phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric chara...
Sort K-Sorted Array
Problem Description Given an array of n elements, where each element is at most k away from its target position, you need to sort the array optimally. geeksforgeeks Solution The problem mention...
Maximum Profit When Buying a Car
Problem Description Given two arrays, A and B of size N. A[i] represents the time by which you can buy the ith car without paying any money. B[i] represents the profit you can earn by buying the i...
Distribute Candy
Problem Description There are n children standing in a line. Each child is assigned a rating value given in the integer array ratings. You are giving candies to these children subjected to the fo...