[LeetCode] 633. Sum of Square Numbers Given a non-negative integer c, decide whether there’re two integers a and b such that a2 + b2 = c. Example 1:Input: c = 5Output: trueExplanation: 1 * 1 + 2 * 2 = 5 Example 2:Input: c & 2021-01-12 #leetcode #java #two pointer #math
[LeetCode] 1695. Maximum Erasure Value You are given an array of positive integers nums and want to erase a subarray containing unique elements. The score you get by erasing the subarray is equal to the sum of its elements. Return the maxi 2021-01-08 #leetcode #java #array #hashmap #two pointer #sliding window #string
[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 #java #array #hashmap #two pointer #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 #tree #dfs #java #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 #java #hashmap #two pointer #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 #bfs #dfs #java #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 #tree #bfs #java
[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 #tree #java #linked list #inorder