2194. Cells in a Range on an Excel Sheet

Updated: 2024-03-12
1 min read
[]

On This Page

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)
        ]