Hello,

I have this code to solve the AOC 2018 day1  part1 challenge

| input input2|
input := Array streamContents: [ :lines |
  'input.txt' asFileReference readStreamDo: [ :in |
    [ in atEnd ] whileFalse: [ lines nextPut: in nextLine ]]].
input inject: 0 into: [ :sum :each | each asInteger + sum  ]

is there a way I can improve this code for example do the counting in the stream ? 

Roelof

Reply via email to