题目: Merge two sorted linked lists and return it as a new list. The new list should be made by splicing togethe…
分类:LeetCode题目解答
[Leetcode] Word Pattern 单词模式
Word Pattern Given a pattern and a string str, find if str follows the same pattern. Examples: pattern = "abba…
【Leetcode】7. Reverse Integer 整数字面反转
1. 题目 Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321 2. 思路 如果是负数,先…
力扣(LeetCode)463
题目地址:https://leetcode-cn.com/probl…题目描述:给定一个包含 0 和 1 的二维网格地图,其中 1 表示陆地 0 表示水域。 网格中的格子水平和垂直方向相连(对角线方向不相连)…
[LeetCode] Jump Game II 跳跃游戏之二
Given an array of non-negative integers, you are initially positioned at the first index of the array. …
[LeetCode] Binary Tree Maximum Path Sum 求二叉树的最大路径和
Given a binary tree, find the maximum path sum. The path may start and end at any node in the tree. For…
[LeetCode] Nth Digit 第N位
Find the nth digit of the infinite integer sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, … Note: n …
[LeetCode] Find K-th Smallest Pair Distance 找第K小的数对儿距离
Given an integer array, return the k-th smallest distance among all the pairs. The distance o…
[Leetcode] Shortest Palindrome 最短回文拼接法
Shortest Palindrome Given a string S, you are allowed to convert it to a palindrome by adding characters in fr…
【leetcode】75. Sort Colors 三颜色的数组排序后同颜色的相邻
1. 题目 Given an array with n objects colored red, white or blue, sort them so that objects of the same color ar…
[LeetCode] Bulb Switcher 灯泡开关
There are n bulbs that are initially off. You first turn on all the bulbs. Then, you turn off…
387. First Unique Character in a String
Given a string, find the first non-repeating character in it and return it’s index. If it doesn’t …