public static void main(String args[]){
        PrintArrayInAdjacentWay paw = new PrintArrayInAdjacentWay();
    //  paw.printArray(5, 2);
        int input[] = {1,3,7,7,1,7,2,3,2};
        System.out.println(paw.numberOfWaysPossible(input, 0));
        System.out.println(paw.numberOfWaysPossibleFaster(input));
    }
Since we know this is same as fibonacci series all we have to do is either use sum of last two numbers if 
total is less than equal to 26 or use just last number if total is greater than 26
total is calculated by creating a number from current number and previous number
@param input
@return
src/com/interview/recursion/PrintArrayInAdjacentWay.java