• + 4 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).