- The program needs to read the input from standard output, so I decided to use cats-effects Console[IO] cause it is blocking
- If the program could work on very large inputs I would wrap algorithmic part into IO.delay for deffering pure computations.
- I think I made wrong assumption that the input should be only console, I will focus now on input validation and making the code split into reusable blocks. Then I will get back to different input handling when the time allows
- I think it is good to replace
List[List[Int]]representing triangle and rather put that in some better structure that the Calculator could use it, also, I think I will switch toVector[Vector[Int]]which I beleive has better read and traversal performance - When building Triangle structure I need to check again if the row length is valid, since
Triangle.fromis public method to use - If we have only a file no stdin we could read the file backward and not load all triangle to the memory. Could be efficient for very large files
- Now when Stdin reader is in place the console one is not needed I suppose