Created
November 5, 2015 23:52
-
-
Save mikekavouras/d8d47c694e2c12a253ca to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func doTheThing(num: Int) -> Int { | |
| guard num != 1 else {return 1} | |
| let diff = [0, -1, 1][num % 3] | |
| print("\(num), \(diff)") | |
| return doTheThing((num + diff) / 3) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment