{"published":"2020-04-24 19:34:13","author_url":"https://blog.hatena.ne.jp/sosodemonai/","author_name":"sosodemonai","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpropyon.hateblo.jp%2Fentry%2F2020%2F04%2F24%2F193413\" title=\"# LeetCode Medium 220. Contains Duplicate III - Neunomizu\u306e\u65e5\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","width":"100%","image_url":null,"provider_url":"https://hatena.blog","type":"rich","title":"# LeetCode Medium 220. Contains Duplicate III","url":"https://propyon.hateblo.jp/entry/2020/04/24/193413","blog_url":"https://propyon.hateblo.jp/","description":"tags: leetcode \u554f\u984c Explore Problems \u30a2\u30a4\u30c7\u30a2 \u6574\u6570\u306e\u914d\u5217nums\u304c\u4e0e\u3048\u3089\u308c\u305f\u3068\u304d\uff0cabs(nums[i] - nums[j]) <= t\u304b\u3064abs(i - j) <= k\u3067\u3042\u308b\u3088\u3046\u306ai\u3068j\u304c\u3042\u308b\u304b\u3092\u63a2\u305b\u3068\u3044\u3046\u554f\u984c\u3067\u3059\uff0e \u89e3\u6cd5 \u307e\u305at\u306f\u975e\u8ca0\u306a\u306e\u3067\u305d\u306e\u6642\u70b9\u3067False\u3092\u8fd4\u3057\u307e\u3059 \u9023\u60f3\u914d\u5217cache[num\u3092t+1\u3067\u5272\u3063\u305f\u5546] = num\u3092\u7528\u610f\u3057\u307e\u3059\uff0e $[0, t], [t + 1, 2t + 1], [2t + 2, 3t + 2]$\u3068$t + 1$\u3054\u3068\u3067\u533a\u5207\u3063\u3066\u9023\u60f3\u914d\u5217\u5185\u3067\u8a18\u9332\u3057\u307e\u3059\uff0e\u8a08\u7b97\u3092\u8a18\u9332\u3059\u308b\u3053\u3068\u3067\u8a08\u7b97\u3059\u308b\u56de\u6570\u3092\u6e1b\u3089\u3057\u307e\u3059\uff0e \u4f8b\u3048\u3070t = 4\u3067num =\u2026","version":"1.0","height":"190","categories":["leetcode"],"provider_name":"Hatena Blog","blog_title":"Neunomizu\u306e\u65e5\u8a18"}