01 2023 档案
摘要:141. Linked List Cycle Given head, the head of a linked list, determine if the linked list has a cycle in it. There is a cycle in a linked list if the
阅读全文
摘要:19. Remove Nth Node From End of List Given the head of a linked list, remove the nth node from the end of the list and return its head. Constraints: T
阅读全文
摘要:143. Reorder List You are given the head of a singly linked-list. The list can be represented as: L0 → L1 → … → Ln - 1 → Ln Reorder the list to be on
阅读全文
摘要:21. Merge Two Sorted Lists You are given the heads of two sorted linked lists list1 and list2. Merge the two lists in a one sorted list. The list shou
阅读全文
摘要:206. Reverse Linked List Given the head of a singly linked list, reverse the list, and return the reversed list. Constraints: The number of nodes in t
阅读全文
摘要:33. Search in Rotated Sorted Array There is an integer array nums sorted in ascending order (with distinct values). Prior to being passed to your func
阅读全文
摘要:153. Find Minimum in Rotated Sorted Array Suppose an array of length n sorted in ascending order is rotated between 1 and n times. For example, the ar
阅读全文
摘要:20. Valid Parentheses Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An inpu
阅读全文
摘要:76. Minimum Window Substring Given two strings s and t of lengths m and n respectively, return the minimum window substring of s such that every chara
阅读全文
摘要:424. Longest Repeating Character Replacement You are given a string s and an integer k. You can choose any character of the string and change it to an
阅读全文
摘要:3. Longest Substring Without Repeating Characters Given a string s, find the length of the longest substring without repeating characters. Constraints
阅读全文
摘要:121. Best Time to Buy and Sell Stock You are given an array prices where prices[i] is the price of a given stock on the ith day. You want to maximize
阅读全文
摘要:11. Container With Most Water You are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the i
阅读全文
摘要:3Sum Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] + nu
阅读全文
摘要:125. Valid Palindrome A phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric cha
阅读全文
摘要:128. Longest Consecutive Sequence Given an unsorted array of integers nums, return the length of the longest consecutive elements sequence. You must w
阅读全文
摘要:271. Encode and Decode Strings 居然要premium才能做,果断换LintCode来写这题 Design an algorithm to encode a list of strings to a string. The encoded string is then s
阅读全文
摘要:238. Product of Array Except Self Given an integer array nums, return an array answer such that answer[i] is equal to the product of all the elements
阅读全文
摘要:347. Top K Frequent Elements Given an integer array nums and an integer k, return the k most frequent elements. You may return the answer in any order
阅读全文
摘要:49. Group Anagrams Given an array of strings strs, group the anagrams together. You can return the answer in any order. An Anagram is a word or phrase
阅读全文
摘要:1. Two Sum Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume th
阅读全文
摘要:242. Valid Anagram Given two strings s and t, return true if t is an anagram of s, and false otherwise. An Anagram is a word or phrase formed by rearr
阅读全文
摘要:217. Contains Duplicate Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element i
阅读全文