Ugly Numbers Problem

sample testcase passes but still WA. Why?


Plz check

The code you have shared is giving segmentation fault.
Refer this and cross check your approach