File tree Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Original file line number Diff line number Diff line change
1
+ let fs = require("fs")
2
+ let input = fs.readFileSync("input.txt").toString().split("\n")
3
+
4
+ const leftNumber=Number(input[0])
5
+
6
+ const a= Number(input[1].split("")[2])
7
+ const b= Number(input[1].split("")[1])
8
+ const c= Number(input[1].split("")[0])
9
+
10
+
11
+ console.log(leftNumber*a)
12
+ console.log(leftNumber*b)
13
+ console.log(leftNumber*c)
14
+ console.log(leftNumber*a+leftNumber*b*10+leftNumber*c*100)
Original file line number Diff line number Diff line change 12
12
if ( sum > m ) return ;
13
13
14
14
if ( L >= answer ) return ;
15
-
16
15
if ( sum === m ) {
17
- // answer = Math.min(answer, L);
16
+ answer = Math . min ( answer , L ) ;
18
17
} else {
19
- // for (let i = 0; i < n; i++) {
20
- // DFS(L + 1, sum + arr[i]);
21
- // }
18
+ for ( let i = 0 ; i < n ; i ++ ) {
19
+ DFS ( L + 1 , sum + arr [ i ] ) ;
20
+ }
22
21
}
23
22
}
24
23
DFS ( 0 , 0 ) ;
You can’t perform that action at this time.
0 commit comments