#122. Best Time to Buy and Sell Stock II
Solved Description You are given an integer array prices where prices[i] is the price of a given stock on the ith day. On each day, you may decide to buy and/or sell the stock. You can only ho...
Solved Description You are given an integer array prices where prices[i] is the price of a given stock on the ith day. On each day, you may decide to buy and/or sell the stock. You can only ho...
Solved 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 are (i, 0) and (i, height[i]). Find two lines...
Solved Description Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] + nums[k] == 0. Notice that the ...
Solved Description Given an integer array nums, rotate the array to the right by k steps, where k is non-negative. Example 1: Input: nums = [1,2,3,4,5,6,7], k = 3 Output: [5,6,7,1,2,3,4] ...
Solved Description Given an integer array nums sorted in non-decreasing order, remove some duplicates in-place such that each unique element appears at most twice. The relative order of the ele...
Solved 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 to a specific target number. Let these two ...
What is Heap? Heap is a kind of Tree Structure. There are 2 types of Heap which are Max Heap and Min Meap. Both Heap have a rule that the parent node must be larger/less than children nodes. Let...
What is Graph? Graph is consisted of nodes and edges. Unlike Tree structure is a directed graph, Graph is undirected graph. In this picture, there are 6 nodes and 6 edges. Node: 1, 2, 3, 4,...
What is Binary Search Tree? Binary Search Tree allows to maintain a sorted list of numbers. It is because Binary Search Tree is also a kind of Binary Tree, it has 2 children nodes. But there is a...
What is Tree? Tree is a nonlinear hierachical data structure. If you imagine a tree, there is a root of tree and so many branches from root. Tree data structure is a reversed version of real tree...