UGLY NUMBERS giving wrong answer

question = https://hack.codingblocks.com/contests/c/452/1271
solution = https://ide.codingblocks.com/#/s/21792
OR
https://ide.codingblocks.com/#/s/21796