Given a linked list, swap every two adjacent nodes and return its head. For example, Given 1->2->3-…
分类:LeetCode题目解答汇总
LeetCode | Scramble String(字符交换)
Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings re…
LeetCode | Rotate List(循环右移链表)
Given a list, rotate the list to the right by k places, where k is non-negative. For examp…
LeetCode | Reverse Linked List II(翻转链表2)
Reverse a linked list from position m to n. Do it in-place and in one-pass. For example: Given&…
LeetCode | Populating Next Right Pointers in Each Node II(将每一层链接成一个链表)
Follow up for problem “Populating Next Right Pointers in Each Node“. What if the given tree could …
LeetCode | Merge Two Sorted Lists(合并两个链表)
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together th…
LeetCode | Restore IP Addresses(恢复ip地址)
Given a string containing only digits, restore it by returning all possible valid IP address combinations. For…
LeetCode | Jump Game II(跳跃游戏II)
Given an array of non-negative integers, you are initially positioned at the first index of the array. Each el…
Lettcode | Two Sum(两个数的和等于定值)
题目: Given an array of integers, find two numbers such that they add up to a specific target number. The functi…
LeetCode | Longest Substring Without Repeating Characters(最长连续不重复子串)
题目: Given a string, find the length of the longest substring without repeating characters. For example, the lo…
LeetCode | Jump Game(跳远游戏)
Given an array of non-negative integers, you are initially positioned at the first index of the array. Each el…
LeetCode | Surrounded Regions(包围的区域)
Given a 2D board containing 'X' and 'O', capture all regions surrounded by 'X'. A region i…