Problem 1676D : X-Sum
I solved the problem using brute force as the constrains were low. In my first try I used another function to do some iterations in a 2D matrix.
Looking at the editorial, they used the same logic but without using another function. So, I copy pasted my entire 'helper' function in my 'main-solver' function and the time difference was pretty huge. Should we avoid using functions in CP?
Using extra function : 168328426 Time taken : 1185ms
Without using another function : 168328365 Time taken : 46ms
Is this something we should take care of in contests?