iT邦幫忙

2025 iThome 鐵人賽

DAY 22
1
Software Development

轉職仔之Data Science and ai master後的持續精進技術之路系列 第 22

I have memorized it 1004 & 是不是要有個自動排程可以上文章XD

  • 分享至 

  • xImage
  •  

https://ithelp.ithome.com.tw/upload/images/20251005/20177944ScTn9TiACH.jpg

https://ithelp.ithome.com.tw/upload/images/20251005/201779449vtra3ngDq.jpg

https://ithelp.ithome.com.tw/upload/images/20251005/20177944DqUsvAVS4o.jpg

#include <vector>

class Solution { // review 1004 O(N) O(1)
public:
    int longestOnes(vector<int>& a, int k) {
        int l = 0, r = 0, n = (int)a.size();
        for (; r < n; ++r) {
            if (a[r] == 0) --k;
            if (k < 0 && a[l++] == 0) ++k;
        }
        return r - l;
    }
};

手機怎麼看不到草稿><究竟能否手機發文呢 worry about it
https://ithelp.ithome.com.tw/upload/images/20251006/20177944IoXbn1aV2W.jpg


上一篇
Sliding Window 9 review & 是否能第一個發文了呢XD
下一篇
I have memorized it 1493 & 希望每天都是星期天~無憂無慮快樂去聊天?(過老的歌曲
系列文
轉職仔之Data Science and ai master後的持續精進技術之路25
圖片
  熱門推薦
圖片
{{ item.channelVendor }} | {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 則留言

1
AndyAWD
iT邦新手 2 級 ‧ 2025-10-06 20:25:31

手機瀏覽器開電腦模式有辦法嗎

還是不能看到草稿><還有文章會repeat:O

我要留言

立即登入留言