[LeetCode] 611. Valid Triangle Number Given an integer array nums, return the number of triplets chosen from the array that can make triangles if we take them as side lengths of a triangle.Example 1:Input: nums = [2,2,3,4]Output: 3Ex 2020-10-02 #leetcode #java #array #two pointer #greedy #sort
[LeetCode] 229. Majority Element II Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. Example 1:Input: nums = [3,2,3]Output: [3] Example 2:Input: nums = [1]Output: [1] Example 3:Inpu 2020-09-23 #leetcode #java #javascript #array
[LeetCode] 979. Distribute Coins in Binary Tree You are given the root of a binary tree with n nodes where each node in the tree has node.val coins. There are n coins in total throughout the whole tree. In one move, we may choose two adjacent nodes 2020-09-22 #leetcode #tree #dfs #java #postorder
[LeetCode] 1291. Sequential Digits An integer has sequential digits if and only if each digit in the number is one more than the previous digit. Return a sorted list of all the integers in the range [low, high] inclusive that have sequ 2020-09-20 #leetcode #bfs #dfs #java #enumeration
[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] 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] 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] 529. Minesweeper Let’s play the minesweeper game (Wikipedia, online game)! You are given an m x n char matrix board representing the game board where: ‘M’ represents an unrevealed mine,‘E’ represents an unrevealed emp 2020-07-23 #leetcode #dfs #java #array #matrix