+ 1
GUYS PLEASE HELP ME SPEED UP THIS PROGRAM. IT PASSES THE SET TIME LIMITATIONS .
Hey People! This question succesfully passes the first as well as second subtask, however for the second subtask- It exceeds the time limit of 1 second and in turn takes close to 2 seconds. I am just in the midst of learning programming in JAVA, thus i wanted a few suggestions from my fellow coders to make my program considerably fast and fit within the time frame.This program is one of the 2 problems that was asked in the 1st stage of selection of Team India for the most prestigious competition for high school programmers. https://code.sololearn.com/cSAprcWd2G3V/?ref=app
5 Answers
+ 3
The Outrageous Indian your welcome, happy coding!
+ 2
Use quick sort instead of selection
+ 2
The test case which failed... would have contains thousands of data...
For large data. Use fastest sorting algorithm such has quicksort, merge sort etc
Selection sort is not good(slow) for large amounts of datas
+ 1
And by the way is that problem from hacker rank? Thanks
+ 1
Thank you so much..!!