Skip to content

Instantly share code, notes, and snippets.

@vrat28
Created May 26, 2021 17:39
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/fe4c658693aeba969debd10f37af042e to your computer and use it in GitHub Desktop.
Save vrat28/fe4c658693aeba969debd10f37af042e to your computer and use it in GitHub Desktop.
Partition Deci-binary
class Solution {
func minPartitions(_ n: String) -> Int {
var maxCharacter = 0
for c in n {
maxCharacter = max(maxCharacter,Int(String(c),radix:10)!)
}
return maxCharacter
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment