For the problem MAXCOUNT, the code below gives Wrong answer. Kindly explain the error.
You have created an array(counter) of size 10000, you need to create it of 10000+1=10001 as the inputted number can be 10000 also. Also you need to run your loop till 10000 rather than less than 10000.
I have made the three changes to your solution 1st the array size to 10^5+1 , loop upto 10^5 and the last loop upto 10^5 as suggested by @asimali246 .