This commit is contained in:
Cyberes 2023-03-14 23:38:55 -06:00
parent 1abc01ef2f
commit 84d24239f7
1 changed files with 0 additions and 9 deletions

View File

@ -1,15 +1,6 @@
from typing import List
def roman_sort(nums: List[str]) -> List[str]:
"""
Contributed by ChatGPT.
"""
values = {"I": 1, "V": 5, "X": 10, "L": 50, "C": 100, "D": 500, "M": 1000}
sorted_nums = sorted(nums, key=lambda x: sum(values[c.upper()] for c in x))
return sorted_nums
def roman_sort_with_ints(arr):
"""
Contributed by ChatGPT, who didn't know how to use .upper()