Project to study Swift
Table of Contents
Create a function that takes a variable number of arguments,
each argument representing the number of items in a group,
and returns the number of permutations (combinations) of
items that you could get by taking one item from each group.
Examples:
combinations(2, 3) ➞ 6
combinations(3, 7, 4) ➞ 84
combinations(2, 3, 4, 5) ➞ 120
Notes:
Don't overthink this one.
Input may include the number zero.
Excercise from: https://edabit.com/challenges/swift
Open the file Combinations.xcodeproj
- Xcode 12.4
- Use iPhone 12 mini as simulator
Daniel Washington Ignacio - danielvertigo@hotmail.com
Click to access my LinkedIn