題目:
給你一個由英文字母和空格組成的字串 s,回傳字串中最後一個單詞的長度。
單詞指由非空格字元組成的最大子字串,並且字串末尾可能有多餘的空格。
解題思路
這...
這題是 977. Squares of a Sorted Array 目的是將已排序的陣列每個元素平方後,按非遞減順序排序回傳。
題目:給定一個已按照非遞減順序...
在Leetcode的題目中,有些題目會要求你不能使用額外的空間、只能原地反轉linked list,這時就會需要用到 In-place reversal of...
HardRelated Topics: Graph / Heap (Priority Queue) / Shortest PathLeetCode Sourc...
961. N-Repeated Element in Size 2N Array
tags: Easy、Sizeof
You are given an int...
559. Maximum Depth of N-ary Tree
tags: Easy、Tree
Given a n-ary tree, find its m...