Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
flat matrix solution in Clear category for Matrix-2-String by Sioul
lowercase = 'abcdefghijklmnopqrstuvwxyz'
uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
def converter(matrix) -> str:
flat_matrix = (e for row in matrix for e in row)
string = ''
for i, e in enumerate(flat_matrix):
if e == 1:
string += lowercase[i]
if e == 2:
string += uppercase[i]
return string
March 11, 2024
Comments: