CNoodle
  • Home
  • Archives
  • Tags
  • About

[LeetCode] 1679. Max Number of K-Sum Pairs

You are given an integer array nums and an integer k. In one operation, you can pick two numbers from the array whose sum equals k and remove them from the array. Return the maximum number of operatio
2021-01-03
#leetcode #array #two pointer #hashmap #java #sort

[LeetCode] 1457. Pseudo-Palindromic Paths in a Binary Tree

Given a binary tree where node values are digits from 1 to 9. A path in the binary tree is said to be pseudo-palindromic if at least one permutation of the node values in the path is a palindrome. Ret
2020-12-30
#leetcode #java #tree #dfs #preorder #backtracking

[LeetCode] 1358. Number of Substrings Containing All Three Characters

Given a string s consisting only of characters a, b and c. Return the number of substrings containing at least one occurrence of all these characters a, b and c. Example 1:Input: s = “abcabc”Outp
2020-12-24
#leetcode #two pointer #hashmap #java #sliding window #string

[LeetCode] 1020. Number of Enclaves

You are given an m x n binary matrix grid, where 0 represents a sea cell and 1 represents a land cell. A move consists of walking from one land cell to another adjacent (4-directionally) land cell or
2020-12-22
#leetcode #java #bfs #dfs #flood fill

[LeetCode] 921. Minimum Add to Make Parentheses Valid

A parentheses string is valid if and only if: It is the empty string, It can be written as AB (A concatenated with B), where A and B are valid strings, or It can be written as (A), where A is a valid
2020-12-18
#leetcode #java #greedy #stack

[LeetCode] 1669. Merge In Between Linked Lists

You are given two linked lists: list1 and list2 of sizes n and m respectively. Remove list1’s nodes from the ath node to the bth node, and put list2 in their place. The blue edges and nodes in the fol
2020-12-15
#leetcode #java #linked list

[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] 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
1…2425262728…46

Search

Hexo Fluid