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

歡迎光臨散文網 會員登陸 & 注冊

LeetCode 2133. Check if Every Row and Column Contains All Number

2023-02-01 15:41 作者:您是打尖兒還是住店呢  | 我要投稿

An?n x n?matrix is?valid?if every row and every column contains?all?the integers from?1?to?n?(inclusive).

Given an?n x n?integer matrix?matrix, return?true?if the matrix is?valid.?Otherwise, return?false.

?

Example 1:

Input: matrix = [[1,2,3],[3,1,2],[2,3,1]]Output: trueExplanation: In this case, n = 3, and every row and column contains the numbers 1, 2, and 3. Hence, we return true.

Example 2:

Input: matrix = [[1,1,1],[1,2,3],[1,2,3]]Output: falseExplanation: In this case, n = 3, but the first row and the first column do not contain the numbers 2 or 3. Hence, we return false.

?

Constraints:

  • n == matrix.length == matrix[i].length

  • 1 <= n <= 100

  • 1 <= matrix[i][j] <= n

Accepted

48,367

Submissions

91,720

Easy 題目,有點不值一提了。loop2個方向,如果有問題就false,沒問題就返回true;


Runtime:?18 ms, faster than?83.24%?of?Java?online submissions for?Check if Every Row and Column Contains All Numbers.

Memory Usage:?43.3 MB, less than?78.96%?of?Java?online submissions for?Check if Every Row and Column Contains All Numbers.


LeetCode 2133. Check if Every Row and Column Contains All Number的評論 (共 條)

分享到微博請遵守國家法律
汽车| 金平| 堆龙德庆县| 新晃| 兴隆县| 营口市| 陈巴尔虎旗| 新巴尔虎左旗| 东乌| 武川县| 高尔夫| 文化| 六安市| 陕西省| 昌邑市| 芦溪县| 穆棱市| 大兴区| 麻江县| 郯城县| 京山县| 青阳县| 晋州市| 攀枝花市| 垦利县| 饶阳县| 丽江市| 芮城县| 太白县| 连城县| 通道| 卢龙县| 宁明县| 淮安市| 申扎县| 长海县| 罗江县| 金寨县| 平阳县| 晋宁县| 行唐县|