public static void printArray(char input[], int size) {
        for(int i=0; i < size; i++){
            System.out.print(input[i] + " ");
        }
        System.out.println();
    }
This method does not uses stack and does inplace conversion
src/com/interview/stackqueue/RemoveExtraBrackets.java