The interview was of course easy, but there were restrictions.
One of them was running code only once sure.
He must have given 3 chances instead of one.
He is right but How do even I know my code is running or not for the first time, I agree that I lost my mind at the interview but I can't agree that a Simple problem can be solved accurately at once. There might be a mistake and debugging is also a part of the job to find your fault in code