public static void main(String args[]) {
        MinimumNumberFromSequence ms = new MinimumNumberFromSequence();
        int output[] = ms.find("DDIDDIID".toCharArray());
        System.out.println(Arrays.toString(output));

        output = ms.find("IIDDD".toCharArray());
        System.out.println(Arrays.toString(output));

        output = ms.find("DIDI".toCharArray());
        System.out.println(Arrays.toString(output));

    }
Date 02/26/2016
@author Tushar Roy

Time complexity : O(n^2)
Space complexity : O(n)

Reference
http://www.geeksforgeeks.org/form-minimum-number-from-given-sequence/
src/com/interview/array/MinimumNumberFromSequence.java