标签:color hang solution bsp ++ bool span while tar
class Solution { public: bool Find(int target, vector<vector<int> > array) { int HangShu = array[0].size(); int LieShu = array.size(); int i = 0; int j = (LieShu - 1); int flag = 0; while ((i < HangShu) && (j >= 0)) { if (array[i][j] < target) { ++i; } else if (array[i][j]>target) { --j; } else { flag = 1; break; } } if (flag == 0) return false; else return true; } };
标签:color hang solution bsp ++ bool span while tar
原文地址:http://www.cnblogs.com/159269lzm/p/7282629.html