-> Int { setupPrerequests() var sum = 0 for k in m...n { sum += 4 * numPatterns(lastNum: 0, currentDotNum: 1, targetDotNum: k) sum += 4 * numPatterns(lastNum: 1, currentDotNum: 1, targetDotNum: k) sum += numPatterns(lastNum: 4, currentDotNum: 1, targetDotNum: k) } return sum } } ࣌ؒෳᯑ: O(n)
ۭؒෳᯑ: O(1)
Runtime: 382 ms