CNoodle
  • Home
  • Archives
  • Tags
  • About

[LeetCode] 897. Increasing Order Search Tree

Given the root of a binary search tree, rearrange the tree in in-order so that the leftmost node in the tree is now the root of the tree, and every node has no left child and only one right child. Exa
2020-12-04
#leetcode #java #tree #linked list #inorder

[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] 135. Candy

There are N children standing in a line. Each child is assigned a rating value. You are giving candies to these children subjected to the following requirements: Each child must have at least one cand
2020-11-03
#leetcode #array #java #greedy

[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
1…2324252627…43

Search

Hexo Fluid