We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
he creates his own sorting method and passes it to sort. sort uses this method to compare each string in the vector. since the numbers overflow he takes the length and compares that first. if the length is equal he returns whether or not the first string is greater than the second.
else he returns whichever has a larger length
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Big Sorting
You are viewing a single comment's thread. Return to all comments →
he creates his own sorting method and passes it to sort. sort uses this method to compare each string in the vector. since the numbers overflow he takes the length and compares that first. if the length is equal he returns whether or not the first string is greater than the second.
else he returns whichever has a larger length