The factorial function, n! is de?ned thus for n a non-negative integer:0! = 1 n! = n×(n?1)! (n > 0)We say that a divides b if there exists an integer ...
分类:
其他好文 时间:
2017-11-10 00:18:10
阅读次数:
154
设计一个简单的web程序,其功能是让用户输入两个整数,并提交给Action,在Action中设计这两个数的代数和,如果代数和为非负数,则跳转到Positive.jsp页面,否则跳转到Negative.jsp页面。 web.xml配置文件 设计控制类Action.jsp struts.xml配置文件 ...
分类:
其他好文 时间:
2017-11-09 22:42:45
阅读次数:
184
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: Input: 5 Output: True E ...
分类:
其他好文 时间:
2017-11-09 15:05:14
阅读次数:
136
Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2. Note: The length of both num1 and num2 is < ...
分类:
其他好文 时间:
2017-11-08 13:32:09
阅读次数:
214
Backtracking: time complexity O(N!) Use HashMap to store the initial debts of each person, negative means the person sends money to others, positive m ...
分类:
其他好文 时间:
2017-11-08 13:17:47
阅读次数:
231
Reservoir sampling is proposed to solve such set of problems: Randomly choose items from a stream of elements where could be very large or unknown in ...
分类:
其他好文 时间:
2017-11-08 13:11:45
阅读次数:
139
697. Degree of an Array Given a non-empty array of non-negative integers nums, the degree of this array is defined as the maximum frequency of any one ...
分类:
其他好文 时间:
2017-11-07 22:17:30
阅读次数:
140
Date: Nov. 4, 2017 Problem: https://leetcode.com/problems/largest-rectangle-in-histogram/description/ Description: Given n non-negative integers repre ...
分类:
其他好文 时间:
2017-11-04 16:36:21
阅读次数:
222
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 contai ...
分类:
其他好文 时间:
2017-11-04 13:20:12
阅读次数:
100
Date: Nov. 3, 2017 Problem: https://leetcode.com/problems/jump-game-ii/description/ Description: Given an array of non-negative integers, you are init ...
分类:
其他好文 时间:
2017-11-03 22:03:02
阅读次数:
242