First pls give a hint
TLE on TEST-4 codeforces
hello @prerak_semwal
hint -> simplify the given expression i.e bring all i terms one side and all j terms other side and then try to make some observation
check now pls
Also is this approach of rearranging quite recurring in these contests ?
…
yeah u can enounter such type of expression in contests.
improve ur logic, its still O(n^2)
check now pls … there will be comparatively less iterations w.r.t to whole program right (as now there are just 2 loops in whole program) ?
…
pls read c++ stl
on codeforces they attach editorial of all the questions after the contest , so u can check solution from editorial section
we can do it with sorting as well.
@aman212yadav
I saw on codeforces it displayed a tag of “hashing” problem…I haven’t reached on hashing in course so can I leave this problem (if this will be taught in future in course) ?
yeah u can leave it for now. after studying hashing u will find this too easy
yeah …
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.