Created
December 17, 2019 16:58
-
-
Save seanchen1991/d8c63f789dcfdf67e70552dd30fc24c8 to your computer and use it in GitHub Desktop.
Revisions
-
seanchen1991 created this gist
Dec 17, 2019 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ # Smallest String Write a function that takes two strings and returns the "smallest" string. If both strings are equal, you may return either string. Strings will only consist of lowercase letters and numbers: [a - z][0 - 9]. Letters earlier in the alphabet are considered smaller. Consecutive digits in the string should be considered a single number. ``` Examples: input: "a", "b" expected output: "a" since "a" comes before "b" alphabetically input: "a1", "a2" expected output: "a1" since 1 comes before 2 input: "a10", "a2" expected output: "a2" since 2 comes before 10 ``` Analyze the time and space complexity of your solution.