Skip to content

Commit 0b4f06f

Browse files
committed
add enclosure
1 parent 20c8b4d commit 0b4f06f

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

RandSum0/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ class genSum {
22
constructor(n) {
33
this.array = []
44
if (n > 0) {
5-
if (n === 1) this.array.push(0)
6-
7-
this.toss(n)
5+
if (n === 1) {
6+
this.array.push(0)
7+
} else {
8+
this.toss(n)
9+
}
810
}
911
}
1012
toss(n) {

0 commit comments

Comments
 (0)