20.Valid Parentheses 題目 給定一個只包含 (, ), {, }, [, ] 的字串 s。 判斷該字串是否為 有效括號序列。 有...
171.Excel Sheet Column Number 題目 給一個 Excel 欄位標題字串 columnTitle(僅包含大寫字母 A-Z),請將其轉換...
160:Intersection of Two Linked Lists 題目 給定兩個單向鏈結串列(Linked List)headA 和 headB。 可能...
122:Best Time to Buy and Sell Stock II 題目 給定一個整數陣列 prices,其中 prices[i] 表示某支股票在第...
53.Maximum Subarray 題目給定一個整數陣列 nums,找到 連續子陣列(至少包含一個元素),使其總和最大,返回該總和。 解題思路 定義兩個變數...
242.Valid Anagram 題目描述 給你兩個字串 s 和 t,判斷 t 是否是 s 的重排列(anagram)。 也就是 t 是否由 s 的所有字母重...
283.Move Zeroes 題目描述 給你一個整數陣列 nums,將所有 0 移動到陣列末尾,同時保持非零元素的相對順序。 必須原地操作 不使用額外陣列 解...
66.Plus One 題目描述 給你一個由整數組成的陣列 digits,其中每個元素都是 0–9,表示一個非負整數的每一位數(高位在前)。 將這個數字加 1,...
217.Contains Duplicate 題目描述 給你一個整數陣列 nums,判斷其中是否有 重複元素。 如果任意值出現至少兩次,返回 true 如果每個...
26.Remove Duplicates from Sorted Array 題目描述 給你一個已排序的整數陣列 nums,原地刪除重複元素,使每個元素只出現一...
121.Best Time to Buy and Sell Stock 題目描述 給你一個整數陣列 prices,其中 prices[i] 表示某支股票第 i...
21.Merge Two Sorted Lists 題目描述 給你兩個 已排序的單向鏈表 list1 和 list2,請將它們合併成一個新的有序鏈表,並返回新鏈...
9.Palindrome Number 題目描述 給你一個整數 x,判斷它是否為回文數。 回文數的定義:正著讀和反著讀一樣 例如:121 → 回文,-121 →...
7.Reverse Integer 題目描述 給你一個 32 位整數 x,將其數字反轉。 例如:123 → 321,-123 → -321 如果反轉後的數字超過...
Given a sorted array of distinct integers and a target value, return the index i...
Given an integer array nums and an integer val, remove all occurrences of val in...
Given an integer array nums sorted in non-decreasing order, remove the duplicate...
Roman numerals are represented by seven different symbols: I, V, X, L, C, D and...
Given an integer x, return true if x is a palindrome, and false otherwise.Exampl...
Given a string s containing just the characters '(', ')', '{', '}', '[' and ']',...
1.Two Sum 題目描述 給你一個整數陣列 nums 和一個目標值 target,請你在陣列中找出 兩個數字,使它們的和等於目標值,並返回它們的索引。 你可...