摘要:
The set S originally contains numbers from 1 to n. But unfortunately, due to the data error, one of the numbers in the set got duplicated to another n 阅读全文
posted @ 2017-10-20 21:53
daniel456
阅读(142)
评论(0)
推荐(0)
摘要:
Find the nth digit of the infinite integer sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ... Note:n is positive and will fit within the range of a 32-bi 阅读全文
posted @ 2017-10-20 21:43
daniel456
阅读(145)
评论(0)
推荐(0)
摘要:
Given a non-negative integer c, your task is to decide whether there're two integers a and b such that a2 + b2 = c. Example 1: Example 2: 阅读全文
posted @ 2017-10-20 21:13
daniel456
阅读(112)
评论(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 @ 2017-10-20 21:04
daniel456
阅读(160)
评论(0)
推荐(0)
摘要:
Given a non-empty integer array of size n, find the minimum number of moves required to make all array elements equal, where a move is incrementing n 阅读全文
posted @ 2017-10-20 21:00
daniel456
阅读(124)
评论(0)
推荐(0)
摘要:
You have a total of n coins that you want to form in a staircase shape, where every k-th row must have exactly k coins. Given n, find the total number 阅读全文
posted @ 2017-10-20 20:53
daniel456
阅读(207)
评论(0)
推荐(0)
摘要:
Given two non-negative integers num1 and num2 represented as string, return the sum of num1 and num2. Note: 求两个字符串的加法 阅读全文
posted @ 2017-10-20 20:42
daniel456
阅读(107)
评论(0)
推荐(0)
摘要:
Given a positive integer num, write a function which returns True if num is a perfect square else False. 题目含义:判断一个数能否被开方 阅读全文
posted @ 2017-10-20 20:39
daniel456
阅读(89)
评论(0)
推荐(0)
摘要:
Given an integer, write a function to determine if it is a power of three. 题目含义:给定一个数,判断它是否是3的n次方 思路:使用换底公式 阅读全文
posted @ 2017-10-20 20:36
daniel456
阅读(121)
评论(0)
推荐(0)
摘要:
Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. For example: Given num = 38, the process is like: 阅读全文
posted @ 2017-10-20 20:31
daniel456
阅读(96)
评论(0)
推荐(0)
摘要:
Given an integer, write a function to determine if it is a power of two. 题目含义:判断一个数是否是2的n次方 阅读全文
posted @ 2017-10-20 20:28
daniel456
阅读(128)
评论(0)
推荐(0)
摘要:
ount the number of prime numbers less than a non-negative number, n. 题目含义:要求计算小于N的所有素数的个数。素数又称质数,是只能被1和自身整数的数 思路:厄拉多塞筛法 西元前250年,希腊数学家厄拉多塞(Eeatosthese) 阅读全文
posted @ 2017-10-20 20:25
daniel456
阅读(111)
评论(0)
推荐(0)
摘要:
Write an algorithm to determine if a number is "happy". A happy number is a number defined by the following process: Starting with any positive intege 阅读全文
posted @ 2017-10-20 20:14
daniel456
阅读(171)
评论(0)
推荐(0)
摘要:
Given an integer n, return the number of trailing zeroes in n!. Note: Your solution should be in logarithmic time complexity. 题目含义:这里我们要求n!末尾有多少个0 思路: 阅读全文
posted @ 2017-10-20 19:49
daniel456
阅读(99)
评论(0)
推荐(0)
摘要:
Related to question Excel Sheet Column Title Given a column title as appear in an Excel sheet, return its corresponding column number. For example: 阅读全文
posted @ 2017-10-20 19:45
daniel456
阅读(118)
评论(0)
推荐(0)
摘要:
Given a positive integer, return its corresponding column title as appear in an Excel sheet. For example: 阅读全文
posted @ 2017-10-20 19:43
daniel456
阅读(154)
评论(0)
推荐(0)
摘要:
Implement int sqrt(int x). Compute and return the square root of x. 题目题目:返回一个int数开方后的结果 阅读全文
posted @ 2017-10-20 19:40
daniel456
阅读(119)
评论(0)
推荐(0)
摘要:
Given a non-negative integer represented as a non-empty array of digits, plus one to the integer. You may assume the integer do not contain any leadin 阅读全文
posted @ 2017-10-20 19:34
daniel456
阅读(138)
评论(0)
推荐(0)
摘要:
Determine whether an integer is a palindrome. Do this without extra space. 题目含义:不要使用额外空间,判断整数是否为回文 阅读全文
posted @ 2017-10-20 19:32
daniel456
阅读(99)
评论(0)
推荐(0)
摘要:
Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321 题目含义翻转一个整数 相关题目:190. Reverse Bits 阅读全文
posted @ 2017-10-20 16:08
daniel456
阅读(97)
评论(0)
推荐(0)
摘要:
Initially on a notepad only one character 'A' is present. You can perform two operations on this notepad for each step: Given a number n. You have to 阅读全文
posted @ 2017-10-20 11:22
daniel456
阅读(192)
评论(0)
推荐(0)
摘要:
You are given n pairs of numbers. In every pair, the first number is always smaller than the second number. Now, we define a pair (c, d) can follow an 阅读全文
posted @ 2017-10-20 11:12
daniel456
阅读(124)
评论(0)
推荐(0)
摘要:
Given a list of non-negative numbers and a target integer k, write a function to check if the array has a continuous subarray of size at least 2 that 阅读全文
posted @ 2017-10-20 11:05
daniel456
阅读(139)
评论(0)
推荐(0)
摘要:
Given a string s, find the longest palindromic subsequence's length in s. You may assume that the maximum length of s is 1000. Example 1:Input: "bbbab 阅读全文
posted @ 2017-10-20 11:00
daniel456
阅读(129)
评论(0)
推荐(0)
摘要:
【基本问题单元的定义】这取决于你所查看问题的角度,找到一个划分,推进问题的角度十分重要。作者找到的方式是dp[ i ][ j ],用来表示 substring( i , j),然后站在这个角度,假设substring(i , j )中的最大的结果是知道的,那么下一步需要确定的是,其如何影响下一个阶段 阅读全文
posted @ 2017-10-20 10:58
daniel456
阅读(336)
评论(0)
推荐(0)
摘要:
You are given a list of non-negative integers, a1, a2, ..., an, and a target, S. Now you have 2 symbols + and -. For each integer, you should choose o 阅读全文
posted @ 2017-10-20 10:41
daniel456
阅读(152)
评论(0)
推荐(0)
摘要:
Given an array of scores that are non-negative integers. Player 1 picks one of the numbers from either end of the array followed by the player 2 and t 阅读全文
posted @ 2017-10-20 10:34
daniel456
阅读(138)
评论(0)
推荐(0)
摘要:
In the computer world, use restricted resource you have to generate maximum benefit is what we always want to pursue. For now, suppose you are a domin 阅读全文
posted @ 2017-10-20 10:18
daniel456
阅读(121)
评论(0)
推荐(0)

浙公网安备 33010602011771号