Skip to content

Instantly share code, notes, and snippets.

@vrat28
Created April 8, 2021 19:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vrat28/2957725b3f1f0fbff9be60e1cb3d468a to your computer and use it in GitHub Desktop.
Save vrat28/2957725b3f1f0fbff9be60e1cb3d468a to your computer and use it in GitHub Desktop.
Letter Combination: Recursion exit condition
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