226. Invert Binary Tree

226. Invert Binary Tree

Problem Invert a binary tree. 4 / \ 2 7 / \ / \ 1 3 6 9 Output: 4 / \ 7 2 / \ / \ 9 6 3 1 Thought Process Can solve this question recursively. if the root is None, return None else, revert root&rs

104. Maximum Depth of Binary Tree

104. Maximum Depth of Binary Tree

Problem Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node. Note: A leaf is a node with no c

20. Valid Parentheses

20. Valid Parentheses

Problem Given a string containing just the characters ‘(’, ‘)’, ‘{’, ‘}’, ‘[’ and ‘]’, determine if the input string is valid. A

Problem Reverse a singly linked list. Example: Input: 1->2->3->4->5->NULL Output: NULL<-1<-2<-3<-4<-5 Follow up: A linked list can be reversed either iteratively or rec

447. Number of Boomerangs

447. Number of Boomerangs

Problem Given n points in the plane that are all pairwise distinct, a “boomerang” is a tuple of points (i, j, k) such that the distance between i and j equals the distance between i and k

454. 4Sum II

454. 4Sum II

Problem Given four lists A, B, C, D of integer values, compute how many tuples (i, j, k, l) there are such that A[i] + B[j] + C[k] + D[l] is zero. To make problem a bit easier, all A, B, C, D have sam

1. Two Sum

1. Two Sum

Problem Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you may not use t

350. Intersection of Two Arrays II

350. Intersection of Two Arrays II

Problem Given two arrays, write a function to compute their intersection. Example 1: Input: nums1 = [1,2,2,1], nums2 = [2,2] Output: [2,2] Example 2: Input: nums1 = [4,9,5], nums2 = [9,4,9,8,4] Out