自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(55)
  • 收藏
  • 关注

原创 [vite]vue2+vite引入svg

背景介绍由于webpack打包太慢,使用vite进行打包,由于更改为vite,原始svg引入产生问题,const svgFiles = require.context('./svg', true, /\.svg$/)console.log("svg",svgFiles)const iconList = svgFiles.keys().map(item => svgFiles(item))因此根据底下大佬文章进行了更改,https://juejin.cn/post/69323512932

2022-04-25 11:41:49 2382

原创 自记录开发问题

1.request.js 文件中接口进行拦截,如果不成功则返回 Promise.reject(new Error(${res.code}-${res.msg || res.message} || 'Error'))无法根据返回的状态进行更改,此时使用promise.then(()=>{}).finally()进行问题解决。2....

2021-08-26 18:22:51 1250

原创 vue页面跳转的方式(自己记录)

1.router-link跳转//不带参数<router-link to = '/index'> <button>go</button></router-link>//带参数<router-link to = "{path: 'index',query:{id:123456}"> <button>go</button></router-link><router-link to = "{pa

2021-08-03 16:55:32 756

原创 elementUI upload组件当auto-upload=“false“设置为flase时候before-upload无法生效

关于elementUI upload组件当auto-upload="false"设置为flase时候before-upload无法生效个人解决方法:通过:on-change进行监听(伪代码) handleChange(file, fileList){ let isFileType = validate(fileType) if (isFileType) { this.$message.warning('仅支持xls/xlsx格式!') fileList.pop() }

2021-07-23 16:27:44 3266

原创 前端问题总结收集

http缓存机制cookie sessionStorage lcoaleStorage,cookie 是不是每一个都能读TCP 三路握手 四路挥手axois:axois.get().then().catch()promise all/race场景题手撕串行 promise 请求手撕图片加载调度器,给一个 urls 的数组和每次最多加载的数量,加载完加载剩下的序列:使用发布者 监听者机制/promise.race()=>使用 hashmap=>hashmap 中设置 key 的值的方.

2020-12-08 20:31:14 82

原创 js继承方式(自存)

js继承的六种继承方式function Person(){ this.name = 'person'}1.原型链继承function Child1(){ this.name = 'child1'}Child1.prototype = new Person()原型链继承让新实例的原型等于父类的实例优势:实例可以继承实例的构造函数的属性,父类的构造函数属性,父类原型的属性(实例不会继承父类实例的属性)劣势:新实例无法向父类构造函数传参、继承单一、所有新实例都会共享父类实例的属性。原型

2020-12-08 20:30:28 85

原创 168. Excel Sheet Column Title

Given a positive integer, return its corresponding column title as appear in an Excel sheet.For example:1 -> A2 -> B3 -> C...26 -> Z27 -> AA28 -> AB ...Example 1:Input: 1...

2019-11-14 10:32:03 110

原创 167. Two Sum II - Input array is sorted

Two Sum II - Input array is sortedGiven an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number.The function twoSum shoul...

2019-11-13 11:31:34 100

原创 141. Linked List Cycle

Linked List CycleGiven a linked list, determine if it has a cycle in it.To represent a cycle in the given linked list, we use an integer pos which represents the position (0-indexed) in the linked...

2019-11-12 10:14:23 82

原创 112. Path Sum

Path SumGiven a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Note: A leaf is a node with no children....

2019-11-11 15:47:56 108

原创 121. Best Time to Buy and Sell Stock

Best Time to Buy and Sell StockSay you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction (i.e., buy one ...

2019-11-08 15:42:33 106

原创 110. Balanced Binary Tree

Balanced Binary TreeGiven a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as:a binary tree in which the left and right subtrees of eve...

2019-11-07 16:00:36 111

原创 125. Valid Palindrome

Valid PalindromeGiven a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.Note: For the purpose of this problem, we define empty string as valid ...

2019-11-06 10:46:31 89

原创 136. Single Number

Single NumberGiven a non-empty array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement...

2019-11-05 10:52:03 97

原创 107. Binary Tree Level Order Traversal II

Binary Tree Level Order Traversal IIGiven a binary tree, return the bottom-up level order traversal of its nodes’ values. (ie, from left to right, level by level from leaf to root).For example:Gi...

2019-11-04 11:10:23 90

原创 102. Binary Tree Level Order Traversal

Binary Tree Level Order TraversalGiven a binary tree, return the level order traversal of its nodes’ values. (ie, from left to right, level by level).For example:Given binary tree [3,9,20,null,nu...

2019-11-03 15:19:50 119

原创 104. Maximum Depth of Binary Tree

Maximum Depth of Binary TreeGiven a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.Note: A l...

2019-11-02 20:19:06 105

原创 101. Symmetric Tree

Symmetric TreeGiven a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree [1,2,2,3,4,4,3] is symmetric:1/ 2 2/ \ / 3 4 4 3...

2019-11-01 17:02:17 86

原创 61. Rotate List

Rotate ListGiven a linked list, rotate the list to the right by k places, where k is non-negative.Example 1:Input: 1->2->3->4->5->NULL, k = 2Output: 4->5->1->2->3->...

2019-10-31 14:51:44 100

原创 91. Decode Ways

Decode WaysA message containing letters from A-Z is being encoded to numbers using the following mapping:‘A’ -> 1‘B’ -> 2…‘Z’ -> 26Given a non-empty string containing only digits, det...

2019-10-30 19:43:35 94

原创 90. Subsets II

Subsets IIGiven 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:...

2019-10-29 10:52:54 66

原创 78. Subsets

SubsetsGiven a set of distinct integers, nums, return all possible subsets (the power set).Note: The solution set must not contain duplicate subsets.Example:Input: nums = [1,2,3]Output:[[3],...

2019-10-28 16:03:05 79

原创 83. Remove Duplicates from Sorted List

Remove Duplicates from Sorted ListGiven a sorted linked list, delete all duplicates such that each element appear only once.Example 1:Input: 1->1->2Output: 1->2Example 2:Input: 1->...

2019-10-26 20:53:13 74

原创 77. Combinations

CombinationsGiven two integers n and k, return all possible combinations of k numbers out of 1 … n.Example:Input: n = 4, k = 2Output:[[2,4],[3,4],[2,3],[1,2],[1,3],[1,4],]python:class ...

2019-10-09 17:05:56 80

原创 60. Permutation Sequence

The set [1,2,3,…,n] contains a total of n! unique permutations.By listing and labeling all of the permutations in order, we get the following sequence for n = 3:“123”“132”“213”“231”“312”“321”G...

2019-10-08 11:19:30 86

原创 55.jumpGame 2

Jump GameGiven an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Deter...

2019-10-07 14:27:02 97

原创 56. Merge Intervals

Given a collection of intervals, merge all overlapping intervals.Example 1:Input: [[1,3],[2,6],[8,10],[15,18]]Output: [[1,6],[8,10],[15,18]]Explanation: Since intervals [1,3] and [2,6] overlaps, m...

2019-09-18 20:51:50 113

原创 53. Maximum Subarray

Maximum SubarrayGiven an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.Example:Input: [-2,1,-3,4,-1,2,1,-5,4],Out...

2019-09-03 16:00:17 77

原创 49. Group Anagrams

Group AnagramsGiven an array of strings, group anagrams together.Example:Input: [“eat”, “tea”, “tan”, “ate”, “nat”, “bat”],Output:[[“ate”,“eat”,“tea”],[“nat”,“tan”],[“bat”]]Note:All input...

2019-09-03 11:05:30 141

原创 46. Permutations

PermutationsGiven a collection of distinct integers, return all possible permutations.Example:Input: [1,2,3]Output:[[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]pythonclass Solution...

2019-08-26 20:29:50 70

原创 43. Multiply Strings

Multiply StringsGiven two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represented as a string.Example 1:Input: num1 = “2”, num2 = “3”Out...

2019-08-25 19:43:48 96

原创 34. Find First and Last Position of Element in Sorted Array

Find First and Last Position of Element in Sorted ArrayGiven an array of integers nums sorted in ascending order, find the starting and ending position of a given target value.Your algorithm’s run...

2019-08-23 10:54:36 127

原创 28. Implement strStr()

Implement strStr()Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.Example 1:Input: haystack = “hello”, needle = “ll”Output: 2Example 2:I...

2019-08-20 10:53:03 68

原创 27. Remove Element

Remove ElementGiven an array nums and a value val, remove all instances of that value in-place and return the new length.Do not allocate extra space for another array, you must do this by modifyin...

2019-08-20 10:26:37 77

原创 26. Remove Duplicates from Sorted Array

Remove Duplicates from Sorted ArrayGiven a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length.Do not allocate extra space for anoth...

2019-08-20 10:20:19 66

原创 24. Swap Nodes in Pairs

Swap Nodes in PairsGiven a linked list, swap every two adjacent nodes and return its head.You may not modify the values in the list’s nodes, only nodes itself may be changed.Example:Given 1->...

2019-08-19 10:34:37 86

原创 22. Generate Parentheses

Generate ParenthesesGiven n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:[“((()))”,“(()())”,“(())(...

2019-08-18 20:35:43 70

原创 matlab相关tips

size()sz = size(A)szdim = size(A,dim)[m,n] = size(A)[sz1,…,szN] = size(A)sz = size(A) 返回一个行向量,其元素包含 A 的相应维度的长度。例如,如果 A 是一个 3×4 矩阵,则 size(A) 返回向量 [3 4]。sz 的长度为 ndims(A)。如果 A 是表或时间表,则 size(A) 返回由...

2019-08-16 21:25:13 293

原创 21. Merge Two Sorted Lists

Merge Two Sorted ListsMerge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.Example:Input: 1->2->4, 1-...

2019-08-16 12:48:18 82

原创 20. Valid Parentheses

Valid ParenthesesGiven a string containing just the characters ‘(’, ‘)’, ‘{’, ‘}’, ‘[’ and ‘]’, determine if the input string is valid.An input string is valid if:Open brackets must be closed by ...

2019-08-16 11:18:14 66

空空如也

空空如也

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

TA关注的人

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