Convert Arcade Score Cards
Context
An arcade challenge stores each player's result as a pair of text values: points earned and level reached. Before the results are placed on the high-score display, convert every pair into integers. Some players may have identical cards, and their original order must remain unchanged.
Problem
Write a function that receives a list of score cards. Every card has exactly two digit strings: its points total followed by its level number. Create a new numeric record for each card by converting both strings to integers. Return all converted records in the same order as the input, keeping repeated cards as repeated records. If the input list is empty, return an empty list. Do not skip, merge, sort, or otherwise alter any card.
Examples
score_cards = [["10", "1"], ["25", "3"], ["10", "1"]][[10, 1], [25, 3], [10, 1]]score_cards = [["0", "0"], ["7", "2"], ["100", "10"]][[0, 0], [7, 2], [100, 10]]score_cards = [][]Constraints
0 <= len(score_cards) <= 1002 <= len(score_cards[i]) <= 2 for every i1 <= len(score_cards[i][j]) <= 8 for every i, jscore_cards[i][j]: alphabet digitsThe strings inside score_cards contain digits only.- Types:
score_cardsis str[][]; result is int[][]
Function signature
def convert_score_cards(score_cards: list[list[str]]) -> list[list[int]]
score_cardslist[list[str]]- A list of two-item text records, where each item is a digit string for points or level.
- returns list[list[int]]
- A new list containing one two-integer record for every input card, in identical order and with identical multiplicity.
Adapted from MBPP problem task_156 (CC BY 4.0). Rewritten, extended and verified by Iksha.
Notes
- Each record always has two fields: points first and level second.
- The result must be newly constructed rather than reusing text records.