This question is part of NeetCode150 series. Problem Description Given a string s, return the longest palindromic substring in s. leetcode Solution This question is similar to: Longest Palindr...
Longest Palindromic Substring
This question is part of NeetCode150 series. Problem Description Given a string s, return the longest palindromic substring in s. leetcode Solution class Solution { //Time complexity: O(n...
House Robber I
This question is part of NeetCode150 series. Problem Description You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only co...
House Robber II
This question is part of NeetCode150 series. Problem Description You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed. All houses ...
Min Cost Climbing Stairs
This question is part of NeetCode150 series. Problem Description Given an integer array nums, return the length of the longest strictly increasYou are given an integer array cost where cost[i] is...
Flip Array
Problem Description Given an array of positive elements, you have to flip the sign of some of its elements such that the resultant sum of the elements of array should be minimum non-negative(as c...
Partition Equal Subset Sum
Problem Description Given a non-empty array nums containing only positive integers, find if the array can be partitioned into two subsets such that the sum of elements in both subsets is equal. l...
Unbounded Knapsack
Problem Description Given weights and values of n items, put these items in a knapsack of capacity W to get the maximum total value in the knapsack. In other words, given two integer arrays val[0....
Knapsack Problem (0/1)
Problem Description Given weights and values of n items, put these items in a knapsack of capacity W to get the maximum total value in the knapsack. In other words, given two integer arrays val[0....
Regular Expression Match
Problem Description Implement wildcard pattern matching with support for ‘?’ and ‘*’ for strings A and B. ’?’ : Matches any single character. ‘*’ : Matches any sequence of characters (includ...