File tree 3 files changed +16
-2
lines changed
3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change
1
+ input = File .read(" ../day1.input" )
2
+ inputArr = input.split(" \n " )
3
+
4
+ noi = 0
5
+ index = 1
6
+
7
+ while index < inputArr.size
8
+ el = inputArr[index].to_i
9
+ prevEl = inputArr[index - 1 ].to_i
10
+ noi += 1 if el > prevEl
11
+ index += 1
12
+ end
13
+
14
+ puts noi
Original file line number Diff line number Diff line change 1
1
const fs = require ( 'fs' )
2
2
3
- const input = fs . readFileSync ( './day1.input' ) . toString ( )
3
+ const input = fs . readFileSync ( '.. /day1.input' ) . toString ( )
4
4
const inputArr = input . split ( "\n" ) . map ( ( e ) => parseInt ( e ) ) ;
5
5
6
6
let numberOfIncrements = 0 ;
Original file line number Diff line number Diff line change 1
1
const fs = require ( 'fs' )
2
2
3
- const input = fs . readFileSync ( './day1.input' ) . toString ( )
3
+ const input = fs . readFileSync ( '.. /day1.input' ) . toString ( )
4
4
const inputArr = input . split ( "\n" ) . map ( ( e ) => parseInt ( e ) ) ;
5
5
6
6
const chunk = 3 ;
You can’t perform that action at this time.
0 commit comments