This sounds like how I approach leetcode. Leetcode feels a bit like math to me anyways. Coding isn't the hard part, understanding the algorithm in conjunction with the data structures is.
Coding is the hard part if you are bad at coding but good at maths and algorithms. Writing accurate code for solving a hard problem in under 30 minutes requires you to be really good at coding.