上一页 1 ··· 41 42 43 44 45 46 47 48 49 ··· 64 下一页
摘要: We run a preorder depth first search on the root of a binary tree. At each node in this traversal, we output D dashes (where D is the depth of this no 阅读全文
posted @ 2020-06-18 03:08 CNoodle 阅读(217) 评论(0) 推荐(0)
摘要: You are given an integer array values where values[i] represents the value of the ith sightseeing spot. Two sightseeing spots i and j have a distance 阅读全文
posted @ 2020-06-17 06:12 CNoodle 阅读(190) 评论(0) 推荐(0)
摘要: Given a string queryIP, return "IPv4" if IP is a valid IPv4 address, "IPv6" if IP is a valid IPv6 address or "Neither" if IP is not a correct IP of an 阅读全文
posted @ 2020-06-17 01:56 CNoodle 阅读(353) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2020-06-16 02:38 CNoodle 阅读(202) 评论(0) 推荐(0)
摘要: Given a sorted array arr, two integers k and x, find the k closest elements to x in the array. The result should also be sorted in ascending order. If 阅读全文
posted @ 2020-06-16 00:36 CNoodle 阅读(309) 评论(0) 推荐(0)
摘要: There are n cities connected by some number of flights. You are given an array flights where flights[i] = [fromi, toi, pricei] indicates that there is 阅读全文
posted @ 2020-06-15 09:47 CNoodle 阅读(342) 评论(0) 推荐(0)
摘要: Given an integer array arr and a target value target, return the integer value such that when we change all the integers larger than value in the give 阅读全文
posted @ 2020-06-15 05:10 CNoodle 阅读(339) 评论(0) 推荐(0)
摘要: Given a set of distinct positive integers nums, return the largest subset answer such that every pair (answer[i], answer[j]) of elements in this subse 阅读全文
posted @ 2020-06-14 10:54 CNoodle 阅读(282) 评论(0) 推荐(0)
摘要: RandomizedCollection is a data structure that contains a collection of numbers, possibly duplicates (i.e., a multiset). It should support inserting an 阅读全文
posted @ 2020-06-13 10:46 CNoodle 阅读(164) 评论(0) 推荐(0)
摘要: You are given an m x n binary matrix grid. An island is a group of 1's (representing land) connected 4-directionally (horizontal or vertical.) You may 阅读全文
posted @ 2020-06-12 14:22 CNoodle 阅读(339) 评论(0) 推荐(0)
摘要: Given an integer array nums and an integer k, return the kth largest element in the array. Note that it is the kth largest element in the sorted order 阅读全文
posted @ 2020-06-12 06:59 CNoodle 阅读(199) 评论(0) 推荐(0)
摘要: Given an integer array nums, move all the even integers at the beginning of the array followed by all the odd integers. Return any array that satisfie 阅读全文
posted @ 2020-06-12 05:33 CNoodle 阅读(82) 评论(0) 推荐(0)
摘要: Note: This is a companion problem to the System Design problem: Design TinyURL. TinyURL is a URL shortening service where you enter a URL such as http 阅读全文
posted @ 2020-06-11 05:58 CNoodle 阅读(154) 评论(0) 推荐(0)
摘要: Given a non-empty array of non-negative integers nums, the degree of this array is defined as the maximum frequency of any one of its elements. Your t 阅读全文
posted @ 2020-06-10 10:09 CNoodle 阅读(242) 评论(0) 推荐(0)
摘要: Given an array of integers nums and an integer k, return the number of contiguous subarrays where the product of all the elements in the subarray is s 阅读全文
posted @ 2020-06-10 08:02 CNoodle 阅读(224) 评论(0) 推荐(0)
摘要: Given two strings s and t, return true if s is a subsequence of t, or false otherwise. A subsequence of a string is a new string that is formed from t 阅读全文
posted @ 2020-06-10 05:09 CNoodle 阅读(356) 评论(0) 推荐(0)
摘要: The i-th person has weight people[i], and each boat can carry a maximum weight of limit. Each boat carries at most 2 people at the same time, provided 阅读全文
posted @ 2020-06-09 09:06 CNoodle 阅读(116) 评论(0) 推荐(0)
摘要: At a lemonade stand, each lemonade costs $5. Customers are standing in a queue to buy from you, and order one at a time (in the order specified by bil 阅读全文
posted @ 2020-06-09 08:16 CNoodle 阅读(130) 评论(0) 推荐(0)
摘要: 给定一个数字,我们按照如下规则把它翻译为字符串:0 翻译成 “a” ,1 翻译成 “b”,……,11 翻译成 “l”,……,25 翻译成 “z”。一个数字可能有多个翻译。请编程实现一个函数,用来计算一个数字有多少种不同的翻译方法。 示例 1: 输入: 12258输出: 5解释: 12258有5种不同 阅读全文
posted @ 2020-06-09 03:29 CNoodle 阅读(280) 评论(0) 推荐(0)
摘要: You are given coins of different denominations and a total amount of money. Write a function to compute the number of combinations that make up that a 阅读全文
posted @ 2020-06-08 12:48 CNoodle 阅读(306) 评论(0) 推荐(0)
上一页 1 ··· 41 42 43 44 45 46 47 48 49 ··· 64 下一页