Skip to content

Instantly share code, notes, and snippets.

@vrat28
Last active April 8, 2021 19:34
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/e238cdca028269b91436259471309f0a to your computer and use it in GitHub Desktop.
Save vrat28/e238cdca028269b91436259471309f0a to your computer and use it in GitHub Desktop.
Letter Combinations main function structure.
func letterCombinations(_ digits: String) -> [String] {
// Empty check
guard digits.isEmpty == false else { return [] }
// Result array
var output = [String]()
// recursive call with "" and index : 0
combinations_dfs_helper(digits,"",0,&output)
return output
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment