自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

热爱编程,热爱技术

你的付出永远不会被辜负 ^-^,不要放弃

  • 博客(320)
  • 问答 (1)
  • 收藏
  • 关注

原创 failed to get sandbox image “k8s.gcr.io/pause:3.6“: failed to pull image “k8s.gcr.io/pause:3.6“

failed to get sandbox image "k8s.gcr.io/pause:3.6": failed to pull image "k8s.gcr.io/pause:3.6"

2022-12-28 21:51:36 4579 5

原创 android使用SmartRefreshLayout库实现下拉刷新和上拉加载

android使用SmartRefreshLayout库实现下拉刷新和上拉加载

2021-04-13 13:21:55 313

原创 数据库索引

相关博客:深入理解数据库索引原理数据库索引到底是什么,是怎样工作的?深入浅出数据库索引原理

2020-12-09 02:08:04 247

原创 清楚CSS浮动

CSS浮动,清除浮动

2020-11-28 05:25:07 216

原创 机器学习相关概念

有帮助的博客:机器学习基本概念与符号系统

2020-10-08 11:50:16 117

原创 mac 下结束python sys.stdin.readline()输出

先按一下回车键,然后再按command+D

2020-09-16 13:26:15 321

原创 C++ 笔试输入输出问题

牛客网笔试题输入输出问题:笔试教训#include<stdio.h>#include<iostream>#include<vector>#include<queue>#include<string.h>#include<math.h>#include<unordered_map>#include<algorithm>#include<deque>#include<se

2020-09-12 18:17:39 548

原创 腾讯笔试: 逛街(单调栈)

题目链接:逛街#include<stdio.h>#include<iostream>#include<vector>#include<queue>#include<string.h>#include<math.h>#include<unordered_map>#include<algorithm>#include<deque>#include<set>#inclu

2020-09-12 06:17:36 346

原创 异或

1. 异或是什么异或,运算符是^二进制的异或,两个数字,如果对应位置相等则为0,不相等则为1,举个例子:01 ^ 10 = 1101 ^ 11= 102. 异或的用处(1)去掉偶数个重复的数比如一个数字 nums = [1,1,2,2,2,3,3]这个数组进行异或运算的话,最后的结果一定是2,因为相同的两个数异或的结果是0,0与任何一个数num进行异或运算,最后结果都是num问题:给出n个正整数,其中n-1个出现了偶数次,1个出现了奇数次,找出这个出现了奇数次的...

2020-09-07 12:17:06 295

原创 判断环的问题

1. 判断有向图是否有环使用拓扑排序解决。每个点都有入度,每次去掉入度为0的点,并且去除相关的边,最后如果去掉的点的数量与原来的点的数量相等,则说明没哟环,否则有环from typing import Listimport collectionsimport sysimport mathfrom functools import cmp_to_keyimport heapqimport copyimport numpy as npclass Solution: def t

2020-09-01 15:42:04 241

原创 KMP python 实现

class Solution: def cal_next(self, str, next): k = -1 for i in range(1, len(next)): while k > 0 and str[k + 1] != str[i]: k = next[k] if str[k + 1] == str[i]: k += 1 .

2020-09-01 09:54:27 144

原创 [Leetcode] 85. Maximal Rectangle 单调栈

85.Maximal Rectangle(题目链接)HardGiven a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and return its area.Example:Input:[ ["1","0","1","0","0"], ["1","0","1","1","1"], ["1","1","1","1","1"], ["1",.

2020-08-25 07:30:37 143

原创 [Leetcode] 42. Trapping Rain Water 单调栈

42.Trapping Rain Water(题目链接)HardGivennnon-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.The above elevation map is represented by array [0,1,0,2,1,0,1,3,2...

2020-08-25 06:54:38 189

原创 [Leetcode] 84. Largest Rectangle in Histogram 单调栈

84.Largest Rectangle in Histogram(题目链接)HardGivennnon-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the histogram.Above is a histogram where width of each bar i...

2020-08-25 06:06:56 148

原创 腾讯笔试:构造回文(使用最长公共子序列) 动态规划

[编程题]构造回文热度指数:32720时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32M,其他语言64M 链接:https://www.nowcoder.com/questionTerminal/28c1dc06bc9b4afd957b01acdf046e69 来源:牛客网 给定一个字符串s,你可以从中删除一些字符,使得剩下的串是一个回文串。如何删除才能使得回文串最长呢?输出需要删除的字符个数。输入描述:输入数据有多组,每组包含一个字符串s,且保证:1<=...

2020-08-22 14:34:08 186

原创 [LeetCode] 644. Maximum Average Subarray II 二分法求平均值

644.Maximum Average Subarray II(题目链接)HardGiven an array consisting ofnintegers, find the contiguous subarray whoselength is greater than or equal tokthat has the maximum average value. And you need to output the maximum average value.Example 1:...

2020-08-22 10:38:46 261

原创 [Lintcode] 44. Interleaving Positive and Negative Numbers 正负交叉数组

44.Interleaving Positive and Negative Numbers (题目链接)Given an array with positive and negative integers. Re-range it to interleaving with positive and negative integers.ExampleExample 1Input : [-1, -2, -3, 4, 5, 6]Outout : [-1, 5, -2, 4, -3, 6]E.

2020-08-21 12:08:29 181

原创 [Lintcode] 143. Sort Colors II 双指针

143.Sort Colors II (题目链接)Given an array ofnobjects withkdifferent colors (numbered from 1 to k), sort them so that objects of the same color are adjacent, with the colors in the order 1, 2, ... k.ExampleExample1Input: [3,2,2,1,4] 4Output: ...

2020-08-21 11:15:07 147

原创 [Leetcode] 75. Sort Colors 双指针

75.Sort Colors (题目链接)MediumGiven an array withnobjects colored red, white or blue, sort themin-placeso that objects of the same color are adjacent, with the colors in the order red, white and blue.Here, we will use the integers 0, 1, and 2 to re...

2020-08-21 08:36:09 108

原创 [Lintcode] 49. Sort Letters by Case 分割数组,双指针

49.Sort Letters by Case (题目链接)Given a string which contains only letters. Sort it by lower case first and upper case second.It'sNOTnecessary to keep the original order of lower-case letters and upper case letters.Have you met this question in a...

2020-08-21 07:35:09 135 1

原创 [Leetcode] 283. Move Zeroes 双指针

283.Move Zeroes (题目链接)EasyGiven an arraynums, write a function to move all0's to the end of it while maintaining the relative order of the non-zero elements.Example:Input: [0,1,0,3,12]Output: [1,3,12,0,0]Note:You must do thisin-placewith...

2020-08-20 10:35:06 118

原创 [Leetcode] 560. Subarray Sum Equals K 找出连续子串的和等于k的子串个数

560.Subarray Sum Equals K(题目链接)MediumGiven an array of integers and an integerk, you need to find the total number of continuous subarrays whose sum equals tok.Example 1:Input:nums = [1,1,1], k = 2Output: 2Constraints:The length of the...

2020-08-19 12:32:20 261

原创 [Leetcode] 237. Delete Node in a Linked List 给出链表中的某个节点,删除该节点

237.Delete Node in a Linked List (题目链接)EasyWrite a function to delete a node (except the tail) in a singly linked list, given only access to that node.Given linked list --head =[4,5,1,9], which looks like following:Example 1:Input: head ...

2020-08-18 12:19:09 115

原创 [Leetcode] 148. Sort List (归并排序链表) 快慢指针

148.Sort List (题目链接)MediumSort a linked list inO(nlogn) time using constant space complexity.Example 1:Input: 4->2->1->3Output: 1->2->3->4Example 2:Input: -1->5->3->4->0Output: -1->0->3->4->5...

2020-08-17 10:58:44 128

原创 [Leetcode] 142. Linked List Cycle II (set / 快慢指针)

142.Linked List Cycle II (题目链接)MediumGiven a linked list, return the node where the cycle begins. If there is no cycle, returnnull.To represent a cycle in the given linked list, we use an integerposwhich represents the position (0-indexed)in the...

2020-08-17 08:36:08 128

原创 [Leetcode] 143. Reorder List 重新排列链表

143.Reorder List (题目链接)MediumGiven a singly linked listL:L0→L1→…→Ln-1→Ln,reorder it to:L0→Ln→L1→Ln-1→L2→Ln-2→…You maynotmodify the values in the list's nodes, only nodes itself may be changed.Example 1:Given 1->2->3->4, reorder i...

2020-08-16 05:10:45 127

原创 2020-08-15

24.Swap Nodes in Pairs (题目链接)MediumGiven alinked list, swap every two adjacent nodes and return its head.You maynotmodify the values in the list's nodes, only nodes itself may be changed.Example:Given 1->2->3->4, you should retur...

2020-08-16 03:52:20 140

原创 [Leetcode] 86. Partition List 链表分组

86.Partition List (题目链接)MediumGiven a linked list and a valuex, partition it such that all nodes less thanxcome before nodes greater than or equal tox.You should preserve the original relative order of the nodes in each of the two partitions.E...

2020-08-15 14:11:38 136

原创 [Leetcode] 92. Reverse Linked List II 指定翻转m~n的链表

92.Reverse Linked List II (题目链接)MediumReverse a linked list from positionmton. Do it in one-pass.Note:1 ≤m≤n≤ length of list.Example:Input: 1->2->3->4->5->NULL, m = 2, n = 4Output: 1->4->3->2->5->NULL思路:...

2020-08-15 13:14:01 119

原创 [Leetcode] 51. N-Queens N皇后问题 (DFS)

51.N-Queens (题目链接)HardThen-queens puzzle is the problem of placingnqueens on ann×nchessboard such that no two queens attack each other.Given an integern, return all distinct solutions to then-queens puzzle.Each solution contains a distinc...

2020-08-13 12:18:26 161

原创 [leetcode] 47. Permutations II 全排列去重

47.Permutations II (题目链接)MediumGiven a collection of numbers that might contain duplicates, return all possible unique permutations.Example:Input: [1,1,2]Output:[ [1,1,2], [1,2,1], [2,1,1]]class Solution: def permuteUnique(self..

2020-08-13 11:19:22 121

原创 [Leetcode] 1278. Palindrome Partitioning III (DFS / 动态规划)

1278.Palindrome Partitioning III (题目链接)HardYou are given a stringscontaining lowercase letters and an integerk. You need to :First, change some characters ofsto other lowercase English letters. Then dividesintoknon-empty disjoint substring...

2020-08-12 18:41:16 165

原创 [Leetcode] 132. Palindrome Partitioning II (动态规划)

132.Palindrome Partitioning II (动态规划)HardGiven a strings, partitionssuch that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindrome partitioning ofs.Example:Input:"aab"Output: 1Explanation: The ...

2020-08-12 17:05:29 90

原创 [Leetcode] 131. Palindrome Partitioning 分割字符串

131.Palindrome Partitioning (题目链接)MediumGiven a strings, partitionssuch that every substring of the partition is a palindrome.Return all possible palindrome partitioning ofs.Example:Input:"aab"Output:[ ["aa","b"], ["a","a","b"]]...

2020-08-12 14:59:00 174

原创 [Leetcode] 863. All Nodes Distance K in Binary Tree 找出距离某个点距离为k的所有的点

863.All Nodes Distance K in Binary Tree (题目链接)MediumWe are given a binary tree (with root noderoot), atargetnode, and an integer valueK.Return a list of the values of allnodes that have a distanceKfrom thetargetnode. The answer can be retu...

2020-08-12 11:08:21 128

原创 [Leetcode] 90. Subsets II 求所有的子集,包含重复元素

90.Subsets II (题目链接)Medium172375Add to ListShareGiven a collection of integers that might contain duplicates,nums, return all possible subsets (the power set).Note:The solution set must not contain duplicate subsets.Example:Input: [1,2,2]O...

2020-08-11 11:38:28 138

原创 [Leetcode] 40. Combination Sum II (DFS)

40.Combination Sum II (题目链接)MediumGiven a collection of candidate numbers (candidates) and a target number (target), find all unique combinations incandidateswhere the candidate numbers sums totarget.Each number incandidatesmay only be usedonc...

2020-08-11 02:32:41 143

原创 [Leetcode] 305. Number of Islands II (并查集)

305.Number of Islands II (并查集)HardA 2d grid map ofmrows andncolumns is initially filled with water. We may perform anaddLandoperation which turns the water at position (row, col) into a land. Given a list of positions to operate,count the numbe...

2020-08-10 10:20:11 205

原创 [Leetcode] 510. Inorder Successor in BST II (中序遍历后继节点)

510.Inorder Successor in BST II (题目链接)MediumGiven anodein a binary search tree, findthe in-order successor of that node in the BST.If that node has no in-order successor, returnnull.The successor of anodeis the node with the smallest key gre...

2020-08-06 14:33:33 221

原创 [Leetcode] 285. Inorder Successor in BST (搜索二叉树中序后继节点)

285.Inorder Successor in BST (题目链接)MediumGiven a binary search tree and a node in it, find the in-order successor of that node in the BST.The successor of a nodepis the node with the smallest key greater thanp.val.Example 1:Input: root ...

2020-08-06 13:15:57 189

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除