LeetCode 39. Combination Sum

Description https://leetcode.com/problems/combination-sum/description/ Given a set of candidate numbers (C) (without duplicates) and a target number (T), find all unique combinations in C where the candidate numbers…

LeetCode 40. Combination Sum II

Description https://leetcode.com/problems/combination-sum-ii/description/ Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the…

LeetCode 155. Min Stack

Description https://leetcode.com/problems/min-stack/description/ Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) —…

LeetCode 69. Sqrt(x) (Java)

Description https://leetcode.com/problems/sqrtx/description/ Implement int sqrt(int x). Compute and return the square root of x. x is guaranteed to be a non-negative integer. Example…

LeetCode 412. Fizz Buzz

Description https://leetcode.com/problems/fizz-buzz/ Write a program that outputs the string representation of numbers from 1 to n. But for multiples of three…

LeetCode 34. Search for a Range

Description https://leetcode.com/problems/search-for-a-range/description/ Given an array of integers sorted in ascending order, find the starting and ending position of a given…

LeetCode 144. Binary Tree Preorder Traversal

Description https://leetcode.com/problems/binary-tree-preorder-traversal/description/ Given a binary tree, return the preorder traversal of its nodes’ values. For example: Given binary tree {1,#,2,3}, 1 \ 2…

LeetCode 35. Search Insert Position

Description https://leetcode.com/problems/search-insert-position/description/ Given a sorted array and a target value, return the index if the target is found. If not,…

LeetCode 122. Best Time to Buy and Sell Stock II

Description https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/description/ Say you have an array for which the ith element is the price of a given stock on day i. Design…

LeetCode 121. Best Time to Buy and Sell Stock

Description https://leetcode.com/problems/best-time-to-buy-and-sell-stock/description/ Say you have an array for which the ith element is the price of a given stock on…