摘要: You are given an array of non-overlapping intervals intervals where intervals[i] = [starti, endi] represent the start and the end of the ith interval 阅读全文
posted @ 2019-11-01 11:18 CNoodle 阅读(498) 评论(0) 推荐(0)
摘要: Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals 阅读全文
posted @ 2019-11-01 02:25 CNoodle 阅读(522) 评论(0) 推荐(0)
摘要: Given an array of meeting time intervals intervals where intervals[i] = [starti, endi], return the minimum number of conference rooms required. Exampl 阅读全文
posted @ 2019-11-01 01:35 CNoodle 阅读(675) 评论(0) 推荐(0)
摘要: 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 阅读(450) 评论(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 阅读(182) 评论(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 阅读(211) 评论(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 阅读(443) 评论(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 阅读(268) 评论(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 阅读(149) 评论(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 阅读(139) 评论(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 阅读(143) 评论(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 阅读(441) 评论(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)