The constraints are very low (N<=500) which means that the simplest brute force solution will pass 100%. Just loop over all the numbers uptp N-1 and check for divisibility and add to sum, then compare the sum with N and output the answer accordingly.
No comments:
Post a Comment