" Do not use any imports, any dictionaries, or dictionary methods. Do not use try-except statements" import csv from typing import TextIO def rotate_map(m: list[list[int]], direction: str) ->...


" Do not use any imports, any dictionaries, or dictionary methods. Do not use try-except statements"


import csv


from typing import TextIO


def rotate_map(m: list[list[int]], direction: str) -> list[list[int]]:
"""
Given a 2D representation of an elevation map , rotate the map either
to the right or to the left, depending on the . A rotation will
be 90 degrees in the direction specified.


Do not modify the original map.


For example:
>>> rotate_map([[1, 2], [3, 4]], 'left')
[[2, 4], [1, 3]]
"""

if direction == 'left':

write a function

elif direction == 'right':

write a function

return m



Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here