Code Challenge #3
- Biyi Akinpelu
- Feb 4, 2023
- 1 min read
Updated: Nov 10, 2023
Spreadsheets often use this alphabetical encoding for its columns:
"A", "B", "C", ..., "AA", "AB", ..., "ZZ", "AAA", "AAB", ....
Given a column number, return its alphabetical column id. For example, given 1, return "A". Given 27, return "AA".
Bonus Challenge Implement 3 stacks using a single list in Python.
Given this data structure:
class Stack: def __init__(self): self.list = [] def pop(self, stack_number): pass def push(self, item, stack_number): pass
Comment below with your solutions.
留言