using System.Collections.Generic;
public static void Main(string[] args)
int noOfPossibilities = 2;
List<int> combinationsList = new List<int>(){1,2};
List<int> noOfWaysList = new List<int>();
Console.WriteLine("Number of steps: {0}", noOfSteps);
Console.WriteLine("Number of possible stepovers: {0}", noOfPossibilities);
if (noOfPossibilities > 0)
combinationsList.ForEach(x => {Console.WriteLine("> {0}", x);});
Console.WriteLine("You can reach your destination in following possible ways");
noOfWaysList = GetArray(noOfWaysList, combinationsList, noOfSteps);
reached = checkReached(noOfWaysList, noOfSteps);
Console.WriteLine(">>>>>>>>>>>>>>>>{0}<<<<<<<<<<<<<<<", noOfWaysList.Count());
Console.WriteLine("you entered an invalid nuber");
private static bool checkReached(List<int> noOfWaysList, int noOfSteps)
foreach (var nwl in noOfWaysList)
private static List<int> GetArray(List<int> possibleWaysList, List<int> stepOvers, int noOfSteps)
if (possibleWaysList == null || possibleWaysList.Count() == 0)
foreach (var stepOver in stepOvers)
possibleWaysList.Add(stepOver);
List<int> dummyList = new List<int>();
foreach (var pwl in possibleWaysList)
foreach (var so in stepOvers)
if ((pwl + so) <= noOfSteps)