public static void main(String args[]){
        NumberOfCombinationsForStairs noc = new NumberOfCombinationsForStairs();
        System.out.println(noc.numberOfWays(7, 4));
    }
Assumption is k is always greater than or equal to 2
src/com/interview/number/NumberOfCombinationsForStairs.java