09 2018 档案
摘要:Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist.
阅读全文
摘要:Given a linked list, return the node where the cycle begins. If there is no cycle, return null. 题意:找一个链表中是否含有环,如果没有则返回null,如果有则返回环的起点 我的解法,投机取巧了,我改了va
阅读全文
摘要:S and T are strings composed of lowercase letters. In S, no letter occurs more than once. S was sorted in some custom order previously. We want to per
阅读全文
摘要:Given a binary array, find the maximum length of a contiguous subarray with equal number of 0 and 1. Example 1: Example 2: Note: The length of the giv
阅读全文
摘要:204. Count Primes 204. Count Primes 204. Count Primes 204. Count Primes Count the number of prime numbers less than a non-negative number, n. Example:
阅读全文
摘要:Given a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x < 10n. Example: Input: 2 Output: 91 Explanation: The answer shoul
阅读全文
摘要:There are N rooms and you start in room 0. Each room has a distinct number in 0, 1, 2, ..., N-1, and each room may have some keys to access the next r
阅读全文
摘要:Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, determine if s can be segmented into a space-separated sequ
阅读全文
摘要:Given a function rand7 which generates a uniform random integer in the range 1 to 7, write a function rand10 which generates a uniform random integer
阅读全文
摘要:题目描述 王强今天很开心,公司发给N元的年终奖。王强决定把年终奖用于购物,他把想买的物品分为两类:主件与附件,附件是从属于某个主件的,下表就是一些主件与附件的例子: 主件 附件 电脑 打印机,扫描仪 书柜 图书 书桌 台灯,文具 工作椅 无 如果要买归类为附件的物品,必须先买该附件所属的主件。每个主
阅读全文
摘要:Given a Binary Search Tree (BST) with the root node root, return the minimum difference between the values of any two different nodes in the tree. Exa
阅读全文
摘要:Given a string S, check if the letters can be rearranged so that two characters that are adjacent to each other are not the same. If possible, output
阅读全文
摘要:Given a positive integer n and you can do operations as follow: If n is even, replace n with n/2. If n is odd, you can replace n with either n + 1 or
阅读全文
摘要:Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. Example: Follow up:Could you do it without any lo
阅读全文
摘要:In a given integer array nums, there is always exactly one largest element. Find whether the largest element in the array is at least twice as much as
阅读全文
摘要:Find all possible combinations of k numbers that add up to a number n, given that only numbers from 1 to 9 can be used and each combination should be
阅读全文

浙公网安备 33010602011771号