IDK I ATTACHED LINK IN QUESTION BUT THEY ARE NOT SHOWING UP SEE LINKS IN COMMENTS BELOW
I tried this:
1
5 2 4 5 4 2
Your code gave output 4, while the real output is 5. I think you are missing the part when the number of numbers occurs twice. BTW, I’ve upvoted you so now you can ask questions.
you can get some more problems on codeforces
In this case, there must be some corner case where your code fails. For example, take code which tells if a number is prime. Your code might run good on numbers b/w 2-100, but if it says 1 is prime, then its wrong.
All in all, there is some case which is proving your approach to be wrong, try to think what it could be.
Oh god.I just messed up my code display here.Very Sorry.
Time limit is diff. for different languages as some languages are slower than other. What do you mean in your firsg point?
Ah, if Java has 2x the time as C/C++ then that explains it. Does Java also have a bigger memory? Some solutions to TRCNTCT have > 4000M usage.
On the second question if you go to the end of the ranklist and put your mouse over a user’s solution it says Total Time like say 5:44 hours. Now I am wondering if that includes the 20 minutes per wrong submission penalty converted into the time?
Thanks!
Yes ot includes penalty. Yes, JAVA is given max memory for reason, irrespective of array/var yoy declare 
You are so helpful. Thank you!
Try learning about big O notation and time complexity. You canc heck geeksforgeeks for this. Roughly, judge executes ~K x 10^7 instructions a second. If N is upto 10^5, then a O(N^2) algorithm will fail as it needs atleast 10^5 x 10^5 = 10^10 instructions.
You dont even need to sort. Just maintain a frequency array, and if any element is coming more than once (2 or 3 times) then include it in answer array. If you go sequentially you wont need to sort answer array as well.
Thank you. 
You no longer need to rely on this thread for answers. You can use “ask the question” feature now. 
You may want to refer to stackoverflow for this question.
i tried but cant get satisfactory ans. i hope will get a help from here
thanks anyway
link : java - how does nextLine discard the input? - Stack Overflow
Its not exactly “discarded”. Its just that there is no variable which is accepting the value, so the scope of the value in “input.next()” ends.
nextLine method doesnt discard the input, it takes the entire line as input. In case again, theres no string to accept that, the input is wasted and it starts reading from next line.