2194. Cells in a Range on an Excel Sheet

Обновлено: 2024-03-12
1 мин
[]

Содержание

LeetCode problem 2194

class Solution:
    def cellsInRange(self, s: str) -> List[str]:
        return [
            chr(i) + str(j)
            for i in range(ord(s[0]), ord(s[-2]) + 1)
            for j in range(int(s[1]), int(s[-1]) + 1)
        ]