随笔分类 - LeetCode
摘要:周赛地址(英):weekly contest 197 周赛地址(中):第 197 场周赛 仓库地址:week-Leetcode 1512. Number of Good Pairs Given an array of integers nums. A pair (i,j) is called goo
阅读全文
摘要:周赛地址(英):weekly contest 196 周赛地址(中):第 196 场周赛 仓库地址:week-Leetcode 1502. Can Make Arithmetic Progression From Sequence Given an array of numbers arr. A s
阅读全文
摘要:周赛地址(英):weekly contest 195 周赛地址(中):第 195 场周赛 仓库地址:week-Leetcode 1496. Path Crossing Given a string path, where path[i] = 'N', 'S', 'E' or 'W', each re
阅读全文
摘要:周赛地址(英):Weekly Contest 194 周赛地址(中):第 194 场周赛 仓库地址:week-Leetcode 1486. XOR Operation in an Array Given an integer n and an integer start. Define an arr
阅读全文
摘要:周赛地址(英):weekly contest 193 周赛地址(中):第 193 场周赛 仓库地址:week-Leetcode 1480. Running Sum of 1d Array Given an array nums. We define a running sum of an array
阅读全文
摘要:给定一个无序的数组,找出数组在排序之后,相邻元素之间最大的差值。 如果数组元素个数小于 2,则返回 0。 示例 1: 输入: [3,6,9,1]输出: 3解释: 排序后的数组是 [1,3,6,9], 其中相邻元素 (3,6) 和 (6,9) 之间都存在最大差值 3。示例 2: 输入: [10]输出:
阅读全文
摘要:162. Find Peak Element A peak element is an element that is greater than its neighbors. Given an input array nums, where nums[i] ≠ nums[i+1], find a p
阅读全文
摘要:160. Intersection of Two Linked Lists Write a program to find the node at which the intersection of two singly linked lists begins. For example, the f
阅读全文
摘要:155. Min Stack Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) -- Push element x onto stack.
阅读全文
摘要:154. Find Minimum in Rotated Sorted Array II Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., [0,
阅读全文
摘要:153. Find Minimum in Rotated Sorted Array Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., [0,1,2
阅读全文
摘要:152. Maximum Product Subarray Given an integer array nums, find the contiguous subarray within an array (containing at least one number) which has the
阅读全文
摘要:151. Reverse Words in a String Given an input string, reverse the string word by word. Example 1: Input: "the sky is blue"Output: "blue is sky the"Exa
阅读全文
摘要:150. Evaluate Reverse Polish Notation Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, *, /. Each
阅读全文
摘要:149. Max Points on a Line Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. Example 1: Example 2: NO
阅读全文
摘要:148. Sort List Sort a linked list in O(n log n) time using constant space complexity. Example 1: Example 2:
阅读全文
摘要:147. Insertion Sort List Sort a linked list using insertion sort. A graphical example of insertion sort. The partial sorted list (black) initially con
阅读全文
摘要:146. LRU Cache Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and put. get
阅读全文
摘要:145. Binary Tree Postorder Traversal Given a binary tree, return the postorder traversal of its nodes' values. Example: Follow up: Recursive solution
阅读全文
摘要:144. Binary Tree Preorder Traversal Given a binary tree, return the preorder traversal of its nodes' values. Example: Follow up: Recursive solution is
阅读全文