超时解法
丑数
http://www.nowcoder.com/questionTerminal/6aa9e04fc3794f68acf8778237ba065b
public class Solution { public int GetUglyNumber_Solution(int index) { int count = 0; int num = 0; while (count < index) { num++; if (isUglyNumber(num)) { count++; } } return num; } public boolean isUglyNumber(int num) { if (num < 1) { return false; } while (num % 2 == 0) { num = num / 2; } while (num % 3 == 0) { num = num / 3; } while (num % 2 == 0) { num = num / 5; } return num == 1; } }