Average Sorting [ AVGSORT] | February Lunchtime 2021 | Hindi Editorial
https://youtu.be/nH5glK5l2xA
https://youtu.be/nH5glK5l2xA
YouTube
Average Sorting [ AVGSORT] | February Lunchtime 2021 | Hindi Editorial
Telegram- https://bit.ly/30jGLHZUSE CODE - SKSAMAGFG for FLAT 10% off on all Geeks For Geeks Courseshttps://practice.geeksforgeeks.org/courses/DSA Course-ht...
i posted this video, really not sure of it, let me know if any problem,
Its just a sponsored video, helps in keeping the channel running
Its just a sponsored video, helps in keeping the channel running
Reason for NO TLE in C
This is because there are total n*(n-1)/2 pairs of two numbers possible. So there can be maximum n*(n-1)/2 different sums possible.
And from the constraint a[i]<=2.5*10^6. So, maximum possible sum will be 5*10^6.
That's why when n*(n-1)/2 is greater than 5*10^6, then answer always exists. So, when n>4000, the there always exist a answer. Hence not getting TLE.
This is because there are total n*(n-1)/2 pairs of two numbers possible. So there can be maximum n*(n-1)/2 different sums possible.
And from the constraint a[i]<=2.5*10^6. So, maximum possible sum will be 5*10^6.
That's why when n*(n-1)/2 is greater than 5*10^6, then answer always exists. So, when n>4000, the there always exist a answer. Hence not getting TLE.
Also same codes are getting accepted after contest which got TLE during the contest