Easy Given an array of characters, compress it in-place. The length after compression must always be smaller t…
分类:LeetCode
80. 删除排序数组中的重复项 II
80. 删除排序数组中的重复项 II 给定一个排序数组,你需要在原地删除重复出现的元素,使得每个元素最多出现两次,返回移除后数组的新长度。 不要使用额外的数组空间,你必须在原地修改输入数组并在使用 额外空间的条件下完成。…
92. Reverse Linked List II
92. Reverse Linked List II 题目 Reverse a linked list from position m to n. Do it in-place and in one-pass. For …
82. Remove Duplicates from Sorted List II && i
题目 83. Remove Duplicates from Sorted List Given a sorted linked list, delete all duplicates such that each ele…
[LeetCode] Populating Next Right Pointers in Each Node II 每个节点的右向指针之二
Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; …
[LeetCode] Reorder List 链表重排序
Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You…
LeetCode 064 Minimum Path Sum
题目描述 Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which mini…
[Leetcode] Set Matrix Zeroes 矩阵置零
Set Matrix Zeroes Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place…
[Leetcode] Reverse Bits 反转位
Reverse Bits Reverse bits of a given 32 bits unsigned integer. For example, given input 43261596 (represented …
力扣(LeetCode)662
题目地址:https://leetcode-cn.com/probl…题目描述:给定一个二叉树,编写一个函数来获取这个树的最大宽度。树的宽度是所有层中的最大宽度。这个二叉树与满二叉树(full binary …
LeetCode从零刷起 (7. Reverse Integer)
LeetCode(7. Reverse Integer) Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, r…
32. 最长有效括号(Swift版)
一、题目 给定一个只包含 ‘(‘ 和 ‘)’ 的字符串,找出最长的包含有效括号的子串的长度。 示例 1: 输入: "(()" 输出: 2 解释: 最长有效括号子串为 "()…