摘要:
Given two strings A and B of lowercase letters, return true if you can swap two letters in A so the result is equal to B, otherwise, return false. Swa 阅读全文
摘要:
Return the lexicographically smallest subsequence of s that contains all the distinct characters of s exactly once. Note: This question is the same as 阅读全文
摘要:
Given an integer array with no duplicates. A maximum tree building on this array is defined as follow: The root is the maximum number in the array. Th 阅读全文
摘要:
Given the root of a Binary Search Tree and a target number k, return true if there exist two elements in the BST such that their sum is equal to the g 阅读全文
摘要:
Given two non-empty binary trees s and t, check whether tree t has exactly the same structure and node values with a subtree of s. A subtree of s is a 阅读全文
摘要:
Given a binary tree, return the tilt of the whole tree. The tilt of a tree node is defined as the absolute difference between the sum of all left subt 阅读全文
摘要:
For a binary tree T, we can define a flip operation as follows: choose any node, and swap the left and right child subtrees. A binary tree X is flip e 阅读全文
摘要:
You are given an array nums of non-negative integers. nums is considered special if there exists a number x such that there are exactly x numbers in n 阅读全文
摘要:
You are given the root node of a binary search tree (BST) and a value to insert into the tree. Return the root node of the BST after the insertion. It 阅读全文
摘要:
Given an array of integers nums and an integer k, return the number of unique k-diff pairs in the array. A k-diff pair is an integer pair (nums[i], nu 阅读全文