leetcode
smart_xiao_xiong
这个作者很懒,什么都没留下…
展开
-
contains duplicate 3
Given an array of integers, find out whether there are two distinct indices i and j in the array such that the difference between nums[i] and nums[j] is at most t and the difference between i an原创 2016-05-09 15:38:49 · 226 阅读 · 0 评论 -
leetcode 74 Search a 2D Matrixf
解法1: 以第一行最后一列作为标尺,与目标之进行比较,根据结果删除第一行或者最后一列。 class Solution { public: bool searchMatrix(vector>& matrix, int target) { int m = matrix.size(), n = matrix[0].size(); for(int r =原创 2016-07-26 17:26:35 · 204 阅读 · 0 评论