1.删除链表中的节点https://leetcode-cn.com/problems/delete-node-in-a-linked-list/ 一开始没看清题目中传入的参数为“要被删除的节点”,找了半天链表在哪 1 class ListNode: 2 def __init__(self, x): ...
分类:
其他好文 时间:
2021-01-28 12:08:24
阅读次数:
0
此博客链接: 回文子串 题目链接:https://leetcode-cn.com/problems/palindromic-substrings/ 题目 给定一个字符串,你的任务是计算这个字符串中有多少个回文子串。 具有不同开始位置或结束位置的子串,即使是由相同的字符组成,也会被视作不同的子串。 示 ...
分类:
其他好文 时间:
2021-01-28 11:54:43
阅读次数:
0
反转一个单链表。 示例: 输入: 1->2->3->4->5->NULL输出: 5->4->3->2->1->NULL进阶:你可以迭代或递归地反转链表。你能否用两种方法解决这道题? 来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/reverse- ...
分类:
其他好文 时间:
2021-01-27 14:05:27
阅读次数:
0
此博客链接:https://www.cnblogs.com/ping2yingshi/p/14331519.html 等价多米诺骨牌对的数量 题目链接:https://leetcode-cn.com/problems/number-of-equivalent-domino-pairs/ 题目 给你一 ...
分类:
其他好文 时间:
2021-01-27 13:43:12
阅读次数:
0
仅供自己学习 题目: The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a ...
分类:
其他好文 时间:
2021-01-27 13:14:49
阅读次数:
0
581. 最短无序连续子数组 给你一个整数数组 nums ,你需要找出一个 连续子数组 ,如果对这个子数组进行升序排序,那么整个数组都会变为升序排序。 请你找出符合题意的 最短 子数组,并输出它的长度。 示例 1: 输入:nums = [2,6,4,8,10,9,15] 输出:5 解释:你只需要对 ...
分类:
编程语言 时间:
2021-01-27 13:10:56
阅读次数:
0
language: C address // nt题,不解释 /** * Note: The returned array must be malloced, assume caller calls free(). */ int* printNumbers(int n, int* returnSiz ...
分类:
其他好文 时间:
2021-01-26 12:26:48
阅读次数:
0
剑指 Offer 57. 和为s的两个数字 地址:剑指 Offer 57. 和为s的两个数字 输入一个递增排序的数组和一个数字s,在数组中查找两个数,使得它们的和正好是s。如果有多对数字的和等于s,则输出任意一对即可。 示例 1: 输入:nums = [2,7,11,15], target = 9 ...
分类:
其他好文 时间:
2021-01-26 12:20:29
阅读次数:
0
剑指 Offer 04. 二维数组中的查找 在一个 n * m 的二维数组中,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。请完成一个高效的函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。 示例: 现有矩阵 matrix 如下: [ [1, 4, 7, 1 ...
分类:
编程语言 时间:
2021-01-26 11:58:21
阅读次数:
0
Problem LeetCode Given the root of a binary tree, return the sum of every tree node's tilt. The tilt of a tree node is the absolute difference between ...
分类:
编程语言 时间:
2021-01-25 11:29:21
阅读次数:
0