Saturday, February 8, 2014

SPOJ 16246. Trener

http://www.spoj.com/problems/TRENER/

This task is another implementation task. I think the best way is to sort teh array then start looking from the beginning , we need to calculate the numebr of consecuetive elements which start with teh same letter, if the number of those elements is greater than 4 that means that we can add that letter to the answer. This might not be the fastest algorithm but it passes in 0.01 wiht using slow intput output.


       DOWNLOAD THE FULL SOURCE CODE

No comments:

Post a Comment