Skip to content

Commit 20c8b4d

Browse files
committed
Add handling '1'
1 parent c93d1eb commit 20c8b4d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

RandSum0/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
class genSum {
22
constructor(n) {
33
this.array = []
4-
if (n > 0) this.toss(n)
4+
if (n > 0) {
5+
if (n === 1) this.array.push(0)
6+
7+
this.toss(n)
8+
}
59
}
610
toss(n) {
711
if (n) {

0 commit comments

Comments
 (0)