### ManikantanV's blog

By ManikantanV, 7 years ago,

Hi! I am unable to detect the bug in my code problem "Ilya and sticks". I have covered separate cases for number of sticks (>=4,=3,=2,=1). Help is appreciated.Thanks

 » 7 years ago, # | ← Rev. 5 →   +1 i have corrected your code: this is the link that got AC. as you can see i have added some segments of code like: if ( modify[i] > 0 && modify[i] < 4 ) modify[i] = 0; else if ( modify[i] >= 4 ) modify[i] -= 4; this ensures that the number of modifies are minimal so in the every if that they are checked there will be no problem. plus i changed the if statements that check modify, take a look.