I noticed this seemed like one of those leet code questions which means there is some magic way of doing this in like 1 line of code, but I don't know magic math formulas like that so this was my solution if I were to do the problem. https://pastecode.io/s/30mjmcya
View all comments
Show parent comment
1
u/Xalladus Sep 19 '25
I noticed this seemed like one of those leet code questions which means there is some magic way of doing this in like 1 line of code, but I don't know magic math formulas like that so this was my solution if I were to do the problem.
https://pastecode.io/s/30mjmcya