随笔分类 - leetcode
摘要:Reverse Linked List Given the head of a singly linked list, reverse the list, and return the reversed list. Example 1: Input: head = [1,2,3,4,5] Outpu
阅读全文
摘要:Excel Sheet Column Title Given an integer columnNumber, return its corresponding column title as it appears in an Excel sheet. For example: A -> 1 B -
阅读全文
摘要:Binary Tree Postorder Traversal Given the root of a binary tree, return the postorder traversal of its nodes' values. Example 1: Input: root = [1,null
阅读全文
摘要:Binary Tree Preorder Traversal Given the root of a binary tree, return the preorder traversal of its nodes' values. Example 1: Input: root = [1,null,2
阅读全文
摘要: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 your
阅读全文
摘要:Arranging Coins You have n coins and you want to build a staircase with these coins. The staircase consists of k rows where the ith row has exactly i
阅读全文
摘要:Repeated Substring Pattern Given a string s, check if it can be constructed by taking a substring of it and appending multiple copies of the substring
阅读全文
摘要:Construct the Rectangle A web developer needs to know how to design a web page's size. So, given a specific rectangular web page’s area, your job by n
阅读全文
摘要:Reverse Words in a String III Given a string s, reverse the order of characters in each word within a sentence while still preserving whitespace and i
阅读全文
摘要:Island Perimeter You are given row x col grid representing a map where grid[i][j] = 1 represents land and grid[i][j] = 0 represents water. Grid cells
阅读全文
摘要:Convert Sorted Array to Binary Search Tree Given an integer array nums where the elements are sorted in ascending order, convert it to a height-balanc
阅读全文
摘要:Valid Palindrome A phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characte
阅读全文
摘要:Intersection of Two Linked Lists Given the heads of two singly linked-lists headA and headB, return the node at which the two lists intersect. If the
阅读全文
摘要:Minimum Depth of Binary Tree Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the ro
阅读全文
摘要:Count Largest Group You are given an integer n. Each number from 1 to n is grouped according to the sum of its digits. Return the number of groups tha
阅读全文
摘要:Reverse Only Letters Given a string s, reverse the string according to the following rules: All the characters that are not English letters remain in
阅读全文
摘要:Pascal's Triangle II Given an integer rowIndex, return the rowIndexth (0-indexed) row of the Pascal's triangle. In Pascal's triangle, each number is t
阅读全文
摘要:Path Sum Given the root of a binary tree and an integer targetSum, return true if the tree has a root-to-leaf path such that adding up all the values
阅读全文
摘要:Maximum Product of Three Numbers Given an integer array nums, find three numbers whose product is maximum and return the maximum product. Example 1: I
阅读全文
摘要:Check Distances Between Same Letters You are given a 0-indexed string s consisting of only lowercase English letters, where each letter in s appears e
阅读全文

浙公网安备 33010602011771号