题目描述 给定一个单向链表,要求删除从结尾数第n个结点,并返回修改后的表头。 样例 给定数组单向链表 1->2->3->4->5 ,以及 n = 2 ,修改后的链表为 1->...

题目描述 给定一个单向链表,要求删除从结尾数第n个结点,并返回修改后的表头。 样例 给定数组单向链表 1->2->3->4->5 ,以及 n = 2 ,修改后的链表为 1->...
[LeetCode] Strobogrammatic Number 对称数 A strobogrammatic number is a number that looks t...
题目:题目地址 题目描述请设计一个栈结构,支持 push、pop、top以及getMin操作,且每个操作的时间复杂度都是 O(1)O(1)。push(x) – 向栈中压入元素...
模拟人工加法的过程。 从低位到高位,依次计算出每一位数字,过程中需要记录进位。如果最高位进位是1,则需要将整个数组后移一位,并在第0个位置写上1。
使用栈数据结构: 遇到左括号,需要压栈。 遇到右括号,判断栈顶是否和当前右括号匹配;若不匹配则返回false,否则匹配弹出栈顶。 最后判断栈是否为空;若为空则合法,否则不合法。
leetcode Day 4 题目:Given an array nums, write a function to move all 0's to the end of i...
Question 求二叉树的最大深度 Given a binary tree, find its maximum depth.The maximum depth is the...
正在复习C++,有理解不对的地方欢迎大家指正~
104. Maximum Depth of Binary TreeLeetcode Day 3 题目:Given a binary tree, find its maximum depth.The maximum depth is the ...
Leetcode Day 3 题目:Given a binary tree, find its maximum depth.The maximum depth is the ...
Leetcode Day 2 题目:The Hamming distance between two integers is the number of positions ...
题目:You're given strings J representing the types of stones that are jewels, and S repre...
Leetcode Day 1 136 Single Number 题目: Given a non-empty array of integers, every element...
Leetcode Day 1 344 Reverse String 题目:Write a function that takes a string as input and ...