@lukharshiv,
Test case: 1 3 1 2 3 3
Correct Output: 1 Your Output: 0
is my appraoch is fine
@lukharshiv, Your code is not passing the mentioned test case. So re check it.