private static List <Result> findResults(List <List <int> > inputList) { List <Result> results = new List <Result>(); // find all result combination for (int i = 0; i < inputList.Count; i++) { if (i == 0) { PyramidUtils.generateFirstResults(inputList[i], results); } else { List <Result> newResults = new List <Result>(); foreach (Result result in results) { List <Result> tempResults = PyramidUtils.findNextNumbersResults(inputList[i], result); if (tempResults != null) { newResults.AddRange(tempResults); } } results.Clear(); results.AddRange(newResults); } } return(results); }
public bool isLastPointEven() { return(PyramidUtils.isEven(path[path.Count - 1])); }