###### 279. Perfect Squares

Problem Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, …) which sum to n. Example 1: Input: n = 12 Output: 3 Explanation: 12 = 4 + 4 + 4.

Read MorePrimer on Python, Algorithms and Data Structure

Problem Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, …) which sum to n. Example 1: Input: n = 12 Output: 3 Explanation: 12 = 4 + 4 + 4.

Read MoreProblem Given a binary tree, return the level order traversal of its nodes’ values. (ie, from left to right, level by level). For example: Given binary tree [3,9,20,null,null,15,7], 3 / \ 9 20 /

Read MoreProblems There are three ways to traverse a binary tree: preorder, inorder and postorder. On Leetcode, there are three problems 144. Binary Tree Preorder Traversal Given a binary tree, return the preo

Read MoreProblems There are three ways to traverse a binary tree: preorder, inorder and postorder. On Leetcode, there are three problems 144. Binary Tree Preorder Traversal Given a binary tree, return the preo

Read MoreDefinition What are Hash Tables? Hash Tables are key-value pairs key must be immutable Hash Function Hash functions convert the value to key One big challenge is to calculate the key more evenly

Read MoreProblem Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. Given linked list – head = [4,5,1,9], which looks like following: 4->5->

Read MoreProblem Given a linked list, swap every two adjacent nodes and return its head. You may not modify the values in the list’s nodes, only nodes itself may be changed. Example: Given 1->2->3-

Read MoreProblem Remove all elements from a linked list of integers that have value val. Example: Input: 1->2->6->3->4->5->6, val = 6 Output: 1->2->3->4->5 Thought Process the r

Read MoreProblem Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i has a greed factor gi, which is the minimum size

Read MoreProblem You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top? Note: Given n will be a po

Read More