Chewbacca and Number

It’s not passing the first test case. but when I remove the (n==5) condition from ‘line 15’ in ‘if-condition’ then it passes the first test but fails the other two cases

Here’s the code:


problem:
https://hack.codingblocks.com/app/contests/509/p/62

p.s. Done without array