LeetCode 12. Integer to Roman

October 28, 2024

Finished a couple easy problems, then this medium problem. I feel like this was made easier by python's list slicing.

Solution

1class Solution:
2 def reverseWords(self, s: str) -> str:
3 return ' '.join(s.split()[::-1])

O(n) = n

LeetCode 12. Integer to Roman

LeetCode 6. Zigzag Conversion