• Skip to primary navigation
  • Skip to content
  • Skip to footer
Isaac Note
  • 技術
  • 總經
  • 標籤
  • 關於

    本頁目錄

    Recent Posts

    • 6.9m 職缺還掛著,3.1% 錄用率先掉到疫情低點:美國勞動市場先進入招聘凍結 04/03
    • 12.33% 關稅降下來了,650 億美元順差仍在:台灣輸美風險已從稅率表移到產能表 03/30
    • Relevant Search 讀書筆記(6):排序函數與商業平衡 03/28
    • 全球 2.9% 的支撐點:AI 投資撐住成長,4.0% 通膨延後降息時鐘 03/27
    • Relevant Search 讀書筆記(6):Phrase Matching 與 Filter/Facet/Aggregation 03/27

    leetcode easy - Contains Duplicate

     LeetCode

    https://leetcode.com/problems/contains-duplicate/

    Code
    class Solution {
        public boolean containsDuplicate(int[] nums) {
            Arrays.sort(nums);


            for ( int i = 0; i < nums.length-1; i++ ) {
                if (nums[i] == nums[i+1]) return true;
            }


            return false;
        }
    } 

    What to read next

    Previous / Next
    Previous: LeetCode Easy - 包含重複元素 Next: MongoDB 入門與 Shell CRUD 操作
    More like this
    • Relevant Search 讀書筆記(6):排序函數與商業平衡 2026-03-28
    • Relevant Search 讀書筆記(6):Phrase Matching 與 Filter/Facet/Aggregation 2026-03-27
    • Relevant Search 讀書筆記(5):Indexing 與 Boolean Search 2026-03-25
    Subscribe via RSS: Macro · Tech

    Tags: leetcode, leetcode easy

    Updated: August 21, 2020

    Share on

    X Facebook LinkedIn Bluesky
    Previous Next
    • Feed
    © 2026 Isaac Note. Powered by Jekyll & Minimal Mistakes.