Skip to content

Instantly share code, notes, and snippets.

# numeral symbol mapping
symbols = {
1:"I",
5:"V",
10:"X",
50:"L",
100:"C",
500:"D",
1000:"M"
}
def maximal_palindrome(s: str) -> str:
"""
Given a string of letters, find the maximum length possible palindrome
Parameters
----------
s : str
input string of letters, e.g. "abaacc"
Returns
from typing import List
def word_count(board: List[List[str]], word: str) -> int:
"""For a given 2-dimensional 'board' of characters, represented by a list of lists, calculate
the number of times a given word appears in the board, either horizontally, vertically, or diagonally
(left-to-right)
Parameters
----------