Not passing some test cases

hello @Sunkumsav
do not hardcode values in ur array.
instead use cin to read input and the apply ur alogorithm on that input.

it is failing in test case1 and case2

check ur updated code->

thanks you sir now it worked