[Leetcode] Search a 2D Matrix
来源:互联网 发布:古墓丽影9a卡优化补丁 编辑:程序博客网 时间:2024/05/02 01:08
class Solution {public: bool searchMatrix(vector<vector<int> > &matrix, int target) { // Start typing your C/C++ solution below // DO NOT write int main() function int i = 0; int j = matrix[0].size() - 1; while (i < matrix.size() && j >= 0) { if (matrix[i][j] > target) --j; else if (matrix[i][j] < target) ++i; else return true; } return false; }};
- [leetcode][Search] Search a 2D Matrix
- LeetCode: Search a 2D Matrix
- LeetCode Search a 2D Matrix
- [Leetcode] Search a 2D Matrix
- LeetCode : Search a 2D Matrix
- [LeetCode] Search a 2D Matrix
- Leetcode 74 Search a 2D Matrix
- leetcode 90: Search a 2D Matrix
- [LeetCode]Search a 2D Matrix
- [Leetcode] Search a 2-D matrix
- [Leetcode]Search a 2D Matrix
- [leetcode]Search a 2D Matrix
- LeetCode-Search a 2D Matrix
- [leetcode] Search a 2D Matrix
- LeetCode - Search a 2D Matrix
- LeetCode:Search a 2D Matrix
- LeetCode 74: Search A 2D Matrix
- leetcode之Search a 2D Matrix
- [Leetcode] Construct Binary Tree from Preorder and Inorder Traversal
- Oracle 跟踪方法--转
- [Leetcode] Convert Sorted Array to Binary Search Tree
- [Leetcode] Convert Sorted List to Binary Search Tree
- [Leetcode] Reverse Integer
- [Leetcode] Search a 2D Matrix
- [Android]点击外层lyout控件改变内层控件颜色
- [Leetcode] Search for a Range
- [Leetcode] Same Tree
- [Leetcode] Valid Parentheses
- [Leetcode] Validate Binary Search Tree
- asp.net 页面生命周期
- C# LIST 使用泛型
- 基数树(radix tree)