[LeetCode] 1609. Even Odd Tree A binary tree is named Even-Odd if it meets the following conditions:The root of the binary tree is at level index 0, its children are at level index 1, their children are at level index 2, etc.For ev 2020-12-10 #leetcode #java #tree #bfs
[LeetCode] 1325. Delete Leaves With a Given Value Given a binary tree root and an integer target, delete all the leaf nodes with value target. Note that once you delete a leaf node with value target, if its parent node becomes a leaf node and has the 2020-12-02 #leetcode #java #tree #recursion #postorder
[LeetCode] 814. Binary Tree Pruning Given the root of a binary tree, return the same tree where every subtree (of the given tree) not containing a 1 has been removed. A subtree of a node node is node plus every node that is a descendant 2020-12-02 #leetcode #java #tree #postorder
[LeetCode] 1010. Pairs of Songs With Total Durations Divisible by 60 You are given a list of songs where the ith song has a duration of time[i] seconds. Return the number of pairs of songs for which their total duration in seconds is divisible by 60. Formally, we want 2020-11-28 #leetcode #array #hashmap #java #two sum #counting sort #MOD
[LeetCode] 395. Longest Substring with At Least K Repeating Characters Given a string s and an integer k, return the length of the longest substring of s such that the frequency of each character in this substring is greater than or equal to k. if no such substring exist 2020-11-27 #leetcode #hashmap #java #sliding window #string #divide and conquer
[LeetCode] 1404. Number of Steps to Reduce a Number in Binary Representation to One Given the binary representation of an integer as a string s, return the number of steps to reduce it to 1 under the following rules:If the current number is even, you have to divide it by 2.If the cur 2020-11-23 #leetcode #java #string #bit manipulation
[LeetCode] 1582. Special Positions in a Binary Matrix Given an m x n binary matrix mat, return the number of special positions in mat. A position (i, j) is called special if mat[i][j] == 1 and all other elements in row i and column j are 0 (row 2020-11-14 #leetcode #array #hashmap #java
[LeetCode] 1283. Find the Smallest Divisor Given a Threshold Given an array of integers nums and an integer threshold, we will choose a positive integer divisor, divide all the array by it, and sum the division’s result. Find the smallest divisor such that the 2020-11-07 #leetcode #array #java #binary search
[LeetCode] 1219. Path with Maximum Gold In a gold mine grid of size m * n, each cell in this mine has an integer representing the amount of gold in that cell, 0 if it is empty. Return the maximum amount of gold you can collect under the con 2020-10-30 #leetcode #java #dfs #backtracking
[LeetCode] 720. Longest Word in Dictionary Given a list of strings words representing an English Dictionary, find the longest word in words that can be built one character at a time by other words in words. If there is more than one possible a 2020-10-29 #leetcode #hashmap #java #sort #string #trie