Skip to content

Files

Latest commit

f523d1f · Aug 24, 2020

History

History
56 lines (33 loc) · 1.23 KB

File metadata and controls

56 lines (33 loc) · 1.23 KB

English Version

题目描述

给你一个矩阵 mat,其中每一行的元素都已经按 递增 顺序排好了。请你帮忙找出在所有这些行中 最小的公共元素

如果矩阵中没有这样的公共元素,就请返回 -1

 

示例:

输入:mat = [[1,2,3,4,5],[2,4,5,8,10],[3,5,7,9,11],[1,3,5,7,9]]
输出:5

 

提示:

  • 1 <= mat.length, mat[i].length <= 500
  • 1 <= mat[i][j] <= 10^4
  • mat[i] 已按递增顺序排列。

解法

Python3

Java

...