五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

LeetCode 2639. Find the Width of Columns of a Grid

2023-04-16 12:16 作者:您是打尖兒還是住店呢  | 我要投稿

You are given a?0-indexed?m x n?integer matrix?grid. The width of a column is the maximum?length?of its integers.

  • For example, if?grid = [[-10], [3], [12]], the width of the only column is?3?since?-10?is of length?3.

Return?an integer array?ans?of size?n?where?ans[i]?is the width of the?ith?column.

The?length?of an integer?x?with?len?digits is equal to?len?if?x?is non-negative, and?len + 1?otherwise.

?

Example 1:

Input: grid = [[1],[22],[333]]

Output: [3]

Explanation: In the 0th column, 333 is of length 3.

Example 2:

Input: grid = [[-15,1,3],[15,7,12],[5,6,-2]]

Output: [3,1,2]

Explanation: In the 0th column, only -15 is of length 3. In the 1st column, all integers are of length 1. In the 2nd column, both 12 and -2 are of length 2.

?

Constraints:

  • m == grid.length

  • n == grid[i].length

  • 1 <= m, n <= 100

  • -109?<= grid[r][c] <= 109

其實(shí)用字符串自帶的length函數(shù)最快了,所以我是轉(zhuǎn)成字符串,求出來對(duì)應(yīng)的值,然后返回的

Runtime:?6 ms, faster than?100.00%?of?Java?online submissions for?Find the Width of Columns of a Grid.

Memory Usage:?44.1 MB, less than?100.00%?of?Java?online submissions for?Find the Width of Columns of a Grid.


LeetCode 2639. Find the Width of Columns of a Grid的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
焦作市| 莱西市| 浑源县| 南川市| 全椒县| 剑河县| 岚皋县| 将乐县| 抚宁县| 柞水县| 浦县| 甘南县| 高雄县| 长沙市| 临沧市| 宣恩县| 库伦旗| 吉木乃县| 嘉鱼县| 咸宁市| 宜良县| 体育| 兴文县| 敖汉旗| 梅河口市| 兴国县| 呈贡县| 台江县| 门头沟区| 罗田县| 聂拉木县| 湖州市| 镇巴县| 宣恩县| 泸州市| 弥勒县| 讷河市| 阜阳市| 潼南县| 龙山县| 翁源县|