Carey Brown wrote: Try exercise sites like https://projecteuler.net/
starts with formal logic, the axiomatization of arithmetic, lambda calculus (the theory of partial recursive functions), and automata theory up through Turing machines.
Junilu Lacar wrote:I don't know if I would have equated the "no throw guarantee" to the use of a try-catch either. There are only a few things that can cause an exception so I would have just put up some guard clauses. Try-catch blocks are expensive and if performance is a primary concern, you should try to avoid using them.
Henry Wong wrote:I think that you forgot about the "sorted" part of the question. There is a very good reason that the inputs are guaranteed to be sorted.
Henry