How to code fast

Can somebody tell how tf this guy submitted 2 solutions in 2 minutes also
without creating any macros. I take at least 2 minutes to fully understand the question and at least 10 min to write the code and test it before submitting.

Practice, Practice and Practice. He might had the solution before hand. Maybe he was cheating or maybe he was a genius. Even I tak atleast 2-3 minutes before being able to understand a question.