[LeetCode] 421. Maximum XOR of Two Numbers in an Array Given an integer array nums, return the maximum result of nums[i] XOR nums[j], where 0 <= i <= j < n.Example 1:Input: nums = [3,10,5,25,2,8]Output: 28Explanation: The maximum r 2020-09-17 #leetcode #java #bit manipulation #trie
[LeetCode] 299. Bulls and Cows You are playing the Bulls and Cows game with your friend. You write down a secret number and ask your friend to guess what the number is. When your friend makes a guess, you provide a hint with the fo 2020-09-11 #leetcode #java #hashmap #string
[LeetCode] 1022. Sum of Root To Leaf Binary Numbers You are given the root of a binary tree where each node has a value 0 or 1. Each root-to-leaf path represents a binary number starting with the most significant bit. For example, if the path is 0 -> 2020-09-09 #leetcode #tree #dfs #java #preorder #recursion
[LeetCode] 875. Koko Eating Bananas Koko loves to eat bananas. There are N piles of bananas, the i-th pile has piles[i] bananas. The guards have gone and will come back in H hours. Koko can decide her bananas-per-hour eating speed of 2020-09-09 #leetcode #java #array #binary search #binary search on answer
[LeetCode] 223. Rectangle Area Given the coordinates of two rectilinear rectangles in a 2D plane, return the total area covered by the two rectangles. The first rectangle is defined by its bottom-left corner (ax1, ay1) and its top- 2020-09-07 #leetcode #java #math #geometry
[LeetCode] 429. N-ary Tree Level Order Traversal Given an n-ary tree, return the level order traversal of its nodes’ values. Nary-Tree input serialization is represented in their level order traversal, each group of children is separated by the null 2020-09-07 #leetcode #tree #bfs #java
590. N-ary Tree Postorder Traversal Given the root of an n-ary tree, return the postorder traversal of its nodes’ values. Nary-Tree input serialization is represented in their level order traversal. Each group of children is separated b 2020-08-13 #leetcode #tree #java #postorder #n-ary tree
[LeetCode] 622. Design Circular Queue Design your implementation of the circular queue. The circular queue is a linear data structure in which the operations are performed based on FIFO (First In First Out) principle, and the last positio 2020-08-03 #leetcode #java #array #design #queue
[LeetCode] 373. Find K Pairs with Smallest Sums You are given two integer arrays nums1 and nums2 sorted in non-decreasing order and an integer k. Define a pair (u, v) which consists of one element from the first array and one element from the secon 2020-08-01 #leetcode #java #array #greedy #heap
[LeetCode] 437. Path Sum III Given the root of a binary tree and an integer targetSum, return the number of paths where the sum of the values along the path equals targetSum. The path does not need to start or end at the root or 2020-07-30 #leetcode #tree #java #preorder #prefix sum