Created
April 8, 2021 19:28
-
-
Save vrat28/2957725b3f1f0fbff9be60e1cb3d468a to your computer and use it in GitHub Desktop.
Letter Combination: Recursion exit condition
This file contains 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 combinations_dfs_helper(_ digits:String,_ current:String,_ index:Int,_ output: inout [String]){ | |
//Exit condition | |
if index == digits.count { | |
output.append(current) | |
return | |
} | |
// logic for exploring candidates | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment