private int[] findLargest1(int[] nums, int k) {
        if (k == 0) {
            return new int[0];
        }
        int[] result = new int[k];
        int index = 0;
        for (int i = 0; i < nums.length; i++) {
            while (index > 0 && index + (nums.length - i - 1) >= k && result[index - 1] < nums[i]) {
                index--;
            }
            if (index < k) {
                result[index++] = nums[i];
            }
        }
        return result;
    }
Date 03/01/2016
@author Tushar Roy

Given two arrays of length m and n with digits 0-9 representing two numbers.
Create the maximum number of length k <= m + n from digits of the two

e.g
nums1 = [3, 4, 6, 5]
nums2 = [9, 1, 2, 5, 8, 3]
k = 5
return [9, 8, 6, 5, 3]

https://leetcode.com/problems/create-maximum-number/
src/com/interview/array/MaxNumberFromTwoArray.java