One minute
Leetcode 1837
Before I explain both solution I just want to say that for me the first solution is not as readable as the second solution but easyer to understand (Note: I wrote the first solution before the second solution so that might be why).
The first solution basicly uses the fact that n
only goes up to 100
and that k
has a range of 2
to 10
Read other posts