http://www.spoj.com/problems/MAJOR/
This task is another implementation task. It can be done using both arrays and maps. I prefer the first option because its easier to implement. The numbers are low so you can just read the input and somehow keep that you read that number once and then add up that number every time you come across to it again.
Make sure to check the source code for implementation details.
This task is another implementation task. It can be done using both arrays and maps. I prefer the first option because its easier to implement. The numbers are low so you can just read the input and somehow keep that you read that number once and then add up that number every time you come across to it again.
Make sure to check the source code for implementation details.
No comments:
Post a Comment