On a staircase, the i-th step has some non-negative cost cost[i] assigned (0 indexed). Once you pay the cost, you can either climb one or two steps. Y ...
分类:
其他好文 时间:
2018-04-15 16:23:57
阅读次数:
143
Given an integer, write an algorithm to convert it to hexadecimal. For negative integer, two’s complement method is used. Note: Example 1: Example 2: ...
分类:
其他好文 时间:
2018-04-15 11:58:07
阅读次数:
124
题目描述: 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 ...
分类:
其他好文 时间:
2018-04-14 16:27:57
阅读次数:
161
Given a non-empty array of non-negative integers nums, the degree of this array is defined as the maximum frequency of any one of its elements. Your t ...
分类:
其他好文 时间:
2018-04-13 16:22:41
阅读次数:
186
题目描述: Count the number of prime numbers less than a non-negative number, n. 要完成的函数: int countPrimes(int n) 说明: 1、题目看上去非常简单和熟悉。给定一个非负数n,要求返回小于n的所有素数的个数 ...
分类:
其他好文 时间:
2018-04-13 16:09:38
阅读次数:
139
Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpo ...
分类:
其他好文 时间:
2018-04-11 19:57:44
阅读次数:
222
Description: Count the number of prime numbers less than a non-negative number, n. 基本思路:筛法 1。 2 为素数。 筛掉以2为因子的数。 即 2 * 2, 2*3, 2*4,2*5 2, 寻找到下一个未被筛除的数。 ...
分类:
其他好文 时间:
2018-04-09 15:05:24
阅读次数:
148
题目描述 Description Given nn non-negative integers, please find the least non-negative integer that doesn’t occur in the nn numbers. Input The first line ...
分类:
编程语言 时间:
2018-04-08 19:51:03
阅读次数:
204
1、题目描述 Given a non-empty array of non-negative integers nums, the degree of this array is defined as the maximum frequency of any one of its elements. ...
分类:
其他好文 时间:
2018-04-08 14:38:51
阅读次数:
168