10 2019 档案

摘要:Given an array of meeting time intervals where intervals[i] = [start, end], determine if a person could attend all meetings. Example 1: Input: interva 阅读全文
posted @ 2019-10-31 23:31 CNoodle 阅读(451) 评论(0) 推荐(0)
摘要:We are playing the Guess Game. The game is as follows: I pick a number from 1 to n. You have to guess which number I picked. Every time you guess wron 阅读全文
posted @ 2019-10-30 23:36 CNoodle 阅读(183) 评论(0) 推荐(0)
摘要:Given a sorted array of distinct integers and a target value, return the index if the target is found. If not, return the index where it would be if i 阅读全文
posted @ 2019-10-30 23:17 CNoodle 阅读(522) 评论(0) 推荐(0)
摘要:Given two strings s and t, determine if they are isomorphic. Two strings s and t are isomorphic if the characters in s can be replaced to get t. All o 阅读全文
posted @ 2019-10-30 02:15 CNoodle 阅读(212) 评论(0) 推荐(0)
摘要:Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively. Below is one possible representati 阅读全文
posted @ 2019-10-30 00:52 CNoodle 阅读(444) 评论(0) 推荐(0)
摘要:Given an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the researcher's h-index. According 阅读全文
posted @ 2019-10-29 01:56 CNoodle 阅读(271) 评论(0) 推荐(0)
摘要:We define the Perfect Number is a positive integer that is equal to the sum of all its positive divisors except itself. Now, given an integer n, write 阅读全文
posted @ 2019-10-28 23:42 CNoodle 阅读(213) 评论(0) 推荐(0)
摘要:You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n, representing the number of elements in num 阅读全文
posted @ 2019-10-23 12:36 CNoodle 阅读(458) 评论(0) 推荐(0)
摘要:Given an integer array nums, move all 0's to the end of it while maintaining the relative order of the non-zero elements. Note that you must do this i 阅读全文
posted @ 2019-10-23 02:22 CNoodle 阅读(156) 评论(0) 推荐(0)
摘要:Given an array of integers nums containing n + 1 integers where each integer is in the range [1, n] inclusive. There is only one repeated number in nu 阅读全文
posted @ 2019-10-23 02:00 CNoodle 阅读(195) 评论(0) 推荐(0)
摘要:Count the number of prime numbers less than a non-negative number, n. Example 1: Input: n = 10 Output: 4 Explanation: There are 4 prime numbers less t 阅读全文
posted @ 2019-10-22 01:38 CNoodle 阅读(146) 评论(0) 推荐(0)
摘要:Write a program to find the n-th ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. Example: Input: n = 10 Outpu 阅读全文
posted @ 2019-10-21 23:50 CNoodle 阅读(150) 评论(0) 推荐(0)
摘要:Write a program to check whether a given number is an ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. Example 阅读全文
posted @ 2019-10-21 13:47 CNoodle 阅读(142) 评论(0) 推荐(0)
摘要: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  阅读全文
posted @ 2019-10-21 13:28 CNoodle 阅读(144) 评论(0) 推荐(0)
摘要:Implement pow(x, n), which calculates x raised to the power n (x^n). Example 1: Input: 2.00000, 10 Output: 1024.00000 Example 2: Input: 2.10000, 3 Out 阅读全文
posted @ 2019-10-18 01:20 CNoodle 阅读(442) 评论(0) 推荐(0)
摘要:Given a positive integer num, write a function which returns True if num is a perfect square else False. Follow up: Do not use any built-in library fu 阅读全文
posted @ 2019-10-18 00:56 CNoodle 阅读(145) 评论(0) 推荐(0)
摘要:Given a non-negative integer x, return the square root of x rounded down to the nearest integer. The returned integer should be non-negative as well. 阅读全文
posted @ 2019-10-18 00:36 CNoodle 阅读(507) 评论(0) 推荐(0)
摘要:Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. Example: Input: 38 Output: 2 Explanation: The pro 阅读全文
posted @ 2019-10-17 23:58 CNoodle 阅读(163) 评论(0) 推荐(0)
摘要:The DNA sequence is composed of a series of nucleotides abbreviated as 'A', 'C', 'G', and 'T'. For example, "ACGAATTCCG" is a DNA sequence. When study 阅读全文
posted @ 2019-10-17 01:04 CNoodle 阅读(204) 评论(0) 推荐(0)
摘要:Given an array nums with n objects colored red, white, or blue, sort them in-place so that objects of the same color are adjacent, with the colors in 阅读全文
posted @ 2019-10-17 00:08 CNoodle 阅读(489) 评论(0) 推荐(0)
摘要:Given a string array words, return the maximum value of length(word[i]) * length(word[j]) where the two words do not share common letters. If no such 阅读全文
posted @ 2019-10-16 23:38 CNoodle 阅读(200) 评论(0) 推荐(0)
摘要:Write a function that takes an unsigned integer and returns the number of '1' bits it has (also known as the Hamming weight). Note: Note that in some 阅读全文
posted @ 2019-10-15 23:48 CNoodle 阅读(470) 评论(0) 推荐(0)
摘要:Given an array nums containing n distinct numbers in the range [0, n], return the only number in the range that is missing from the array. Example 1: 阅读全文
posted @ 2019-10-15 23:13 CNoodle 阅读(205) 评论(0) 推荐(0)
摘要:Given the head of a singly linked list, reverse the list, and return the reversed list. Example 1: Input: head = [1,2,3,4,5] Output: [5,4,3,2,1] Examp 阅读全文
posted @ 2019-10-14 11:51 CNoodle 阅读(179) 评论(0) 推荐(0)
摘要:Write an algorithm to determine if a number n is happy. A happy number is a number defined by the following process: Starting with any positive intege 阅读全文
posted @ 2019-10-14 11:27 CNoodle 阅读(237) 评论(0) 推荐(0)
摘要:You are given two non-empty linked lists representing two non-negative integers. The most significant digit comes first and each of their nodes contai 阅读全文
posted @ 2019-10-13 14:42 CNoodle 阅读(251) 评论(0) 推荐(0)
摘要:You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes conta 阅读全文
posted @ 2019-10-13 06:41 CNoodle 阅读(486) 评论(0) 推荐(0)
摘要:Implement the myAtoi(string s) function, which converts a string to a 32-bit signed integer. The algorithm for myAtoi(string s) is as follows: Whitesp 阅读全文
posted @ 2019-10-13 01:06 CNoodle 阅读(457) 评论(0) 推荐(0)
摘要:Write a function that reverses a string. The input string is given as an array of characters s. You must do this by modifying the input array in-place 阅读全文
posted @ 2019-10-12 08:45 CNoodle 阅读(164) 评论(0) 推荐(0)
摘要:The array-form of an integer num is an array representing its digits in left to right order. For example, for num = 1321, the array form is [1,3,2,1]. 阅读全文
posted @ 2019-10-12 00:58 CNoodle 阅读(291) 评论(0) 推荐(0)
摘要:Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if: 阅读全文
posted @ 2019-10-11 01:22 CNoodle 阅读(479) 评论(0) 推荐(0)
摘要:Given a string s, find the first non-repeating character in it and return its index. If it does not exist, return -1. Example 1: Input: s = "leetcode" 阅读全文
posted @ 2019-10-10 07:23 CNoodle 阅读(178) 评论(0) 推荐(0)
摘要:Given two stings ransomNote and magazine, return true if ransomNote can be constructed from magazine and false otherwise. Each letter in magazine can 阅读全文
posted @ 2019-10-10 06:46 CNoodle 阅读(313) 评论(0) 推荐(0)
摘要:Given two strings s and t, return true if t is an anagram of s, and false otherwise. An Anagram is a word or phrase formed by rearranging the letters 阅读全文
posted @ 2019-10-10 06:08 CNoodle 阅读(232) 评论(0) 推荐(0)
摘要:You are given a large integer represented as an integer array digits, where each digits[i] is the ith digit of the integer. The digits are ordered fro 阅读全文
posted @ 2019-10-10 02:17 CNoodle 阅读(715) 评论(0) 推荐(0)
摘要:Given an unsorted array of integers nums, return the length of the longest consecutive elements sequence. You must write an algorithm that runs in O(n 阅读全文
posted @ 2019-10-09 11:11 CNoodle 阅读(524) 评论(0) 推荐(0)
摘要:Given the head of a linked list and an integer val, remove all the nodes of the linked list that has Node.val == val, and return the new head. Example 阅读全文
posted @ 2019-10-09 08:59 CNoodle 阅读(187) 评论(0) 推荐(0)
摘要:Given an integer array nums, return true if there exists a triple of indices (i, j, k) such that i < j < k and nums[i] < nums[j] < nums[k]. If no such 阅读全文
posted @ 2019-10-09 08:35 CNoodle 阅读(231) 评论(0) 推荐(0)
摘要:Given an integer array nums and an integer val, remove all occurrences of val in nums in-place. The relative order of the elements may be changed. Sin 阅读全文
posted @ 2019-10-09 08:07 CNoodle 阅读(455) 评论(0) 推荐(0)
摘要:Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bit integer range [-23 阅读全文
posted @ 2019-10-09 00:52 CNoodle 阅读(462) 评论(0) 推荐(0)
摘要:Design a data structure that accepts a stream of integers and checks if it has a pair of integers that sum up to a particular value. Implement the Two 阅读全文
posted @ 2019-10-09 00:25 CNoodle 阅读(206) 评论(0) 推荐(0)
摘要:Given a 1-indexed array of integers numbers that is already sorted in non-decreasing order, find two numbers such that they add up to a specific targe 阅读全文
posted @ 2019-10-08 10:33 CNoodle 阅读(189) 评论(0) 推荐(0)
摘要:Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each inp 阅读全文
posted @ 2019-10-08 10:15 CNoodle 阅读(735) 评论(0) 推荐(0)