Best Time to Buy and Sell Stock with Cooldown Leetcode Solution

Problem statement In the problem “Best Time to Buy and Sell Stock with Cooldown” we are given an array where each element in the array contains the price of the given stock on that day. There is no restriction on the number of transactions. The definition of the transaction is …

Read more

Best Time to Buy and Sell Stock  II Leetcode Solution

Problem statement In the problem “Best Time to Buy and Sell Stock  II,” we are given an array where each element in the array contains the price of the given stock on that day. The definition of the transaction is buying one share of stock and selling that one share …

Read more

Best Time to Buy and Sell Stock with Transaction Fee Leetcode Solution

Problem statement In the problem “Best Time to Buy and Sell Stock with Transaction Fee,” we are given an array where each element in the array contains the price of the given stock on that day. The definition of the transaction is buying one share of stock and selling that …

Read more

Count Negative Numbers in a Sorted Matrix LeetCode Solution

Problem statement In the problem “Count Negative Numbers in a Sorted Matrix” we are given a matrix of n rows and m columns. Elements are sorted in decreasing order both row-wise and column-wise. We need to find the total number of negative elements in the matrix. Example grid = [[8,3,2,-1],[4,2,1,-1],[3,1,-1,-2],[-1,-1,-2,-3]] …

Read more

Subset Leetcode

In Subset Leetcode problem we have given a set of distinct integers, nums, print all subsets (the power set). Note: The solution set must not contain duplicate subsets. An array A is a subset of an array B if a can be obtained from B by deleting some (possibly, zero …

Read more

Translate »