LeetCode
LeetCode: 82-Remove Duplicates from Sorted List II 解題紀錄
題目
Given the head
of a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. Return the linked list sorted as well.
Read More »LeetCode: 82-Remove Duplicates from Sorted List II 解題紀錄LeetCode: 383-Counting Bits 解題紀錄
題目
Given an integerRead More »LeetCode: 383-Counting Bits 解題紀錄n
, return an arrayans
of lengthn + 1
such that for eachi
(0 <= i <= n
),ans[i]
is the number of1
's in the binary representation ofi
.
LeetCode: 133-Clone Graph 解題思路
題目
Given a reference of a node in a connected undirected graph. Return a deep copy (clone) of the graph. Each node in the graph contains a value (Read More »LeetCode: 133-Clone Graph 解題思路int
) and a list (List[Node]
) of its neighbors.
LeetCode: 171-Excel Sheet Column Number 解題紀錄
題目
Given a string columnTitle
that represents the column title as appear in an Excel sheet, return its corresponding column number.
Read More »LeetCode: 171-Excel Sheet Column Number 解題紀錄LeetCode: 169-Majority Element 解題紀錄
題目
Given an arrayRead More »LeetCode: 169-Majority Element 解題紀錄nums
of sizen
, return the majority element. The majority element is the element that appears more than⌊n / 2⌋
times. You may assume that the majority element always exists in the array.