Skip to content

Instantly share code, notes, and snippets.

@inspirit941
Created December 6, 2019 08:46
Show Gist options
  • Save inspirit941/8c017be02943741a8fd603912457be20 to your computer and use it in GitHub Desktop.
Save inspirit941/8c017be02943741a8fd603912457be20 to your computer and use it in GitHub Desktop.
import re
def solution(files):
# 1.
temp = [re.split(r"([0-9]+)", s) for s in files]
print(temp)
# 2.
sort = sorted(temp, key = lambda x: (x[0].lower(), int(x[1])))
# 3.
return ["".join(s) for s in sort]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment