https://kotlinlang.org logo
Title
a

Andrew Gazelka

03/08/2019, 12:27 AM
for Project Euler / LeetCode projects iyo how does it make the most sense to setup the project? - each problem extends
Problem<I,O>
...
I
is input,
O
is output and implements
fun solve(input: I): O
- each problem extends
Problem<O>
where input is provided in constructor - each problem is a top-level function - each problem is a HOF
I'd think functions potentially since if a state does not need to be preserved it should be a function???
I guess functions kinda fail in the case where I want two implementations of the same problem, though
perhaps a HOF is a better solution