maxrye1996/meta_coding_puzzles

Cafeteria erroneous short circuit

Opened this issue · 0 comments

Thanks for putting these up. I'm still trying to understand the O(n) solution but...

if int(N / (K + 1)) == M:

I may be wrong but I believe the result incorrectly returns 0 for inputs of:

N = 14
K = 2
M = 4
S = [1, 4, 7, 10]

The answer should be 1 as either seat 13 or 14 is available.

Thanks again.