摘要: 因为时间序列有序,从后往前遍历一次,总时间要么是前一个时间点减后一个时间点,要么是吃满中毒持续时间。 class Solution { public: int findPoisonedDuration(vector<int>& timeSeries, int duration) { int coun 阅读全文
posted @ 2018-08-17 22:22 Lokianyu 阅读(106) 评论(0) 推荐(0)
摘要: 思路就是三重循环遍历即可,反正不卡时间复杂度(逃 class Solution { public: int triangleNumber(vector<int>& nums) { int count = 0; for(int i = 0; i < nums.size(); i++) for(int 阅读全文
posted @ 2018-08-17 21:58 Lokianyu 阅读(380) 评论(0) 推荐(0)