You are viewing a single comment's thread. Return to all comments →
Thank you, that did it! A lot of these challenges require mathematical trickery/shortcuts. "Brute force" coding won't work for a lot of them. The result is that many of these challenges measure mathematical ability more than they measure coding ability.
Well, after all this problem is in the Algorithms section. Finding out a way to reduce time complexity is all about skillfulness in algorithmic programming.
Mind you, if it really were only mathematical trickery such as knowing some obscure theorem in number theory, then I would agree with you. But this rather is algorithmic trickery which is to be expected with algorithmic exercises.