Run error, I don't know how, it working perfectly fine in CB ide
hello @rajharsh865
ur array size was small , always use n (input ) to declare ur array .
pls check ur updated code here (comment added) ->
it is working fine now->

hello @rajharsh865
ur array size was small , always use n (input ) to declare ur array .
pls check ur updated code here (comment added) ->
it is working fine now->
