The first case is clearer to me than the second, by quite away.
Iter, next? Opaque testing of [-1] values?
Adjusting a few identifier names, the first actually describes what's going on.
Eg., rename `Monotonic()` to `CurrentLtLast()`
Iter, next? Opaque testing of [-1] values?
Adjusting a few identifier names, the first actually describes what's going on.
Eg., rename `Monotonic()` to `CurrentLtLast()`
I think OP missed the point here: the interviewer was probably testing the candidate's Python chops by offering an opportunity to show off their knowledge of language features and standard library on a simple problem. The result is contrived by using __call__ and itertools, but is better for the purposes of the interview.