数学
文章平均质量分 72
LQCUN
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
338. Counting Bits
Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary representation and return them as an array. Example: For num = 5 y原创 2018-02-05 11:06:51 · 135 阅读 · 0 评论 -
423. Reconstruct Original Digits from English
Given a non-empty string containing an out-of-order English representation of digits 0-9, output the digits in ascending order.Note:Input contains only lowercase English letters.Input is guaranteed to...原创 2018-02-22 15:17:43 · 159 阅读 · 0 评论 -
357. Count Numbers with Unique Digits
Given a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x < 10n. Example:Given n = 2, return 91. (The answer should be the total numbers in the range of 0 ≤ x < 100...原创 2018-02-20 15:56:32 · 142 阅读 · 0 评论 -
343. Integer Break
Given a positive integer n, break it into the sum of at least two positive integers and maximize the product of those integers. Return the maximum product you can get.For example, given n = 2, return ...原创 2018-02-20 09:58:37 · 148 阅读 · 0 评论 -
382. Linked List Random Node
Given a singly linked list, return a random node's value from the linked list. Each node must have the same probability of being chosen.Follow up:What if the linked list is extremely large and its len...原创 2018-02-17 12:50:48 · 138 阅读 · 0 评论 -
453. Minimum Moves to Equal Array Elements
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 - 1 elements by 1.Example:Input: [1,2,3] Output: ...原创 2018-02-16 14:22:21 · 123 阅读 · 0 评论 -
672. Bulb Switcher II
There is a room with n lights which are turned on initially and 4 buttons on the wall. After performing exactly m unknown operations towards buttons, you need to return how many different kinds of sta...原创 2018-02-13 13:00:16 · 168 阅读 · 0 评论 -
553. Optimal Division
Given a list of positive integers, the adjacent integers will perform the float division. For example, [2,3,4] -> 2 / 3 / 4. However, you can add any number of parenthesis at any position to change t原创 2018-02-07 10:15:03 · 107 阅读 · 0 评论 -
292. Nim Game
You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 stones. The one who removes the last stone will be the原创 2018-02-07 09:29:08 · 153 阅读 · 0 评论 -
717. 1-bit and 2-bit Characters
We have two special characters. The first character can be represented by one bit 0. The second character can be represented by two bits (10 or 11). Now given a string represented by several bits. Re...原创 2018-02-12 11:19:27 · 147 阅读 · 0 评论 -
258. Add Digits
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: 3 + 8 = 11, 1 + 1 = 2. Since 2 has only one digit,...原创 2018-02-11 12:59:25 · 123 阅读 · 0 评论 -
667. Beautiful Arrangement II
Given two integers n and k, you need to construct a list which contains n different positive integers ranging from 1 to n and obeys the following requirement: Suppose this list is [a1, a2, a3, ... , a...原创 2018-02-11 12:52:37 · 174 阅读 · 0 评论 -
462. Minimum Moves to Equal Array Elements II
Given a non-empty integer array, find the minimum number of moves required to make all array elements equal, where a move is incrementing a selected element by 1 or decrementing a selected element by ...转载 2018-02-10 20:02:27 · 114 阅读 · 0 评论 -
476. Number Complement
Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation. Note: The given integer is guaranteed to fit within the range of原创 2018-02-05 11:18:34 · 143 阅读 · 0 评论 -
268. Missing Number
Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array.Example 1Input: [3,0,1] Output: 2 Example 2Input: [9,6,4,2,3,5,7,0,1] Output: 8 Not...原创 2018-03-29 10:53:30 · 179 阅读 · 0 评论
分享