private int getKthUglyNumber(int k) {
		if(k <= 0) {
			return 0;
		}
		
		int[] ugly_numbers = new int[k];
		ugly_numbers[0] = 1;
		
		int next_index = 1;
		
		int next_2 = 0;
		int next_3 = 0;
		int next_5 = 0;
		
		while(next_index < k){
			ugly_numbers[next_index] = min(ugly_numbers,next_2,next_3,next_5);
			
			while(ugly_numbers[next_2] * 2 <= ugly_numbers[next_index]){
				++next_2;
			}
			
			while(ugly_numbers[next_3] * 3 <= ugly_numbers[next_index]) {
				++next_3;
			}
			
			while(ugly_numbers[next_5] * 5 <= ugly_numbers[next_index]) {
				++next_5;
			}
			
			++next_index;
		}
		
		return ugly_numbers[k - 1];
		
	}