You are viewing a single comment's thread. Return to all comments →
your solution is good but due to sorting it will take O(nlogn) time which can be optimized to O(n).
Here is the video explaination of my solution in O(n) time - https://youtu.be/6N86QrB_6n8
and you can find most of the hackerrank solutions with video explaination here- https://github.com/Java-aid/Hackerrank-Solutions
and many more needs to be addeed.
Regards,
Kanahaiya Gupta
Git Hub URL | https://github.com/Java-aid/
LIKE US | https://www.facebook.com/javaaid/
SUBSCRIBE US | https://goo.gl/jziyfZ
TELEGRAM LINK| @javaaid">@javaaid">https://web.telegram.org/#/im?p=@javaaid
Seems like cookies are disabled on this browser, please enable them to open this website
Mini-Max Sum
You are viewing a single comment's thread. Return to all comments →
your solution is good but due to sorting it will take O(nlogn) time which can be optimized to O(n).
Here is the video explaination of my solution in O(n) time - https://youtu.be/6N86QrB_6n8
and you can find most of the hackerrank solutions with video explaination here- https://github.com/Java-aid/Hackerrank-Solutions
and many more needs to be addeed.
Regards,
Kanahaiya Gupta
Git Hub URL | https://github.com/Java-aid/
LIKE US | https://www.facebook.com/javaaid/
SUBSCRIBE US | https://goo.gl/jziyfZ
TELEGRAM LINK| @javaaid">@javaaid">https://web.telegram.org/#/im?p=@javaaid