Could you elaborate on those techniques from competitive programming please. Genuinely interested! :)

+1 This is definitely the wall I hit with competitive programming. I logically know how to solve the problem, my code just ends up having one too many bugs that I can’t track down before time is up.