You are viewing a single comment's thread. Return to all comments →
For anyone who is having issues with the running time: i had the same when i used factorial to compute (n choose 2).
Rather than using factorial you can use a simple formula: n * (n - 1) which is equal to (n choose 2).
Seems like cookies are disabled on this browser, please enable them to open this website
Sherlock and Pairs
You are viewing a single comment's thread. Return to all comments →
For anyone who is having issues with the running time: i had the same when i used factorial to compute (n choose 2).
Rather than using factorial you can use a simple formula: n * (n - 1) which is equal to (n choose 2).