二维数组中的查找

static const auto io_sync_off=[](){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
return nullptr;
}();
class Solution {
public:
bool Find(int target, vector<vector<int> > array) {

int row = array.size();
int column = array[0].size();
int a = 0;
for(int i=0;i<row;i++)
{
for(int j=0;j<column;j++)
{
if(array[i][j]==target)
{
a++;
return true;
}
}
}
return false;
}
};
全部评论

相关推荐

06-18 08:36
湖南大学 Java
运营你豪哥:没啥拷打的 1.增加量化结果,现在有点缺效果数据 2.突出复杂性,现在的项目描述有点像功能清单,强调一下技术难点和解决方案。
不给转正的实习,你还去吗
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务