Given the root of a binary tree and an integer distance. A pair of two different leaf nodes of a binary tree is said to be good if the length ...
Given an array of integersnums. A pair i,j is calledgoodifnums i nums j andi lt j. Return the number ofgoodpairs. Example : Example : Example : Constraints: lt nums.length lt lt nums i lt 题意是给一个数组,求的是 ...
2020-07-13 04:33 0 596 推荐指数:
Given the root of a binary tree and an integer distance. A pair of two different leaf nodes of a binary tree is said to be good if the length ...
Given a list of unique words. Find all pairs of distinct indices (i, j) in the given list, so that the concatenation of the two words, i.e. words ...
Given a linked list, swap every two adjacent nodes and return its head. For example,Given 1->2-& ...
原题地址:http://oj.leetcode.com/problems/swap-nodes-in-pairs/ 题意:将链表中的节点两两交换。Given 1->2->3->4, you should return the list as 2->1->4-> ...
题目: Given a linked list, swap every two adjacent nodes and return its head. For example, Given ...
Implement a MapSum class with insert, and sum methods. For the method insert, you'll be give ...
Given an array nums, we call (i, j) an important reverse pair if i < j and nums[i] > 2*nums[j]. You need to return the number of important ...
Problem Description: A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down). Write a function ...