That is the basic problem with show and tell with a low-level language.
You either have a simple working example, with a dozen edge cases not caught.
Or you have the usual check-hedge growth around Input and Output - which makes the Code hard to read.
They chose the correct examples for the task- thus they where right, and your expert was wrong.