AC solution using Python3


  • 0
    S

    just share my simple solution

    python3 <<EOF
    matrix = [line[:-1].split(' ') for line in open('file.txt')]
    for column in range(len(matrix[0])):
        print(*(matrix[row][column] for row in range(len(matrix))))
    EOF
    

    <<EOF is really a helpful syntax


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.