Sorted Array code error

The above code shows wrong answer in Testcase #2. What is the issue in it?

@yashomar95,
If the input is:
4
0 1 1 2
Correct Output : true
Your output: false

if I include the equal operator in line 21 of the code , then testcase 1 and 3 fails and testcase 2 passes.

@yashomar95,
https://ide.codingblocks.com/s/155990 I have done using scanner class.

yaah…it’s solved…thanks…I want to know why is this happening when i am taking the input through bufferedreader?

@yashomar95,
The input test cases sometimes give error for bufferedreader. I would suggest practice using scanner class only.