摘要: 1 int longestConsecutive(const vector<int> &num) { 2 unordered_map<int, int> hash; 3 for (int i=0; i<num.size(); ++i) 4 hash[num[i]] = 1; 5 6 int ans=0; 7 for (int i=0; i<num.size(); ++i) { 8 unordered_map<int, int>::iterator it = hash.find(num[i]+1);; 9 fo... 阅读全文
posted @ 2013-04-28 14:09 caijinlong 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 1 class Solution { 2 public: 3 void solve(vector<vector<char>>& board) { 4 if (board.empty()) return; 5 int n = board.size(); 6 int m = board[0].size(); 7 // Top-most line 8 for (int j = 0; j < m; ++j) 9 if (board[0][j] == 'O')10 ... 阅读全文
posted @ 2013-04-28 13:18 caijinlong 阅读(123) 评论(0) 推荐(0) 编辑