topic:
2639. Query the width of each column in the grid diagram.md
Thought:
The first thing I think is to usemapTo solve,[list(map(lambda x: len(str(x)), row)) for row in grid]
Build such an expression,但是topic要求找到列的最大值,If it is done by yourself so manually, you need itO(n^2)Time complexity,SonumpyYou can easily find the iterative value of each column。
Code:
1 | import numpy as np |
1 | impl Solution { |