摘要: leetcode 给定一个字符串 s ,请你找出其中不含有重复字符的 最长子串 的长度。 方法一:采用双指针加哈希表,滑动窗口思想。 即左右指针left,right。从前往后遍历字符串。righ自增,同时哈希表维护记录[left,righ]中字符的下标。遇到重复字符,就更新左指针left的位置,保证 阅读全文
posted @ 2021-09-30 22:10 梨云梦暖 阅读(222) 评论(0) 推荐(0)
摘要: [leetcode-最长回文子串](https://leetcode-cn.com/problems/longest-palindromic-substring/) **给定一个字符串 s,找到 s 中最长的回文子串。** 1. 核心思想:中心扩散法,从中间开始向两边扩散来判断回文串。我们以一个字符 阅读全文
posted @ 2021-09-25 22:21 梨云梦暖 阅读(96) 评论(0) 推荐(0)
摘要: [leetcode 两数之和](https://leetcode-cn.com/problems/two-sum/) >给定一个整数数组 nums 和一个整数目标值 target,请你在该数组中找出 和为目标值 target 的那 两个 整数,并返回它们的数组下标。 你可以假设每种输入只会对应一个答 阅读全文
posted @ 2021-09-20 17:03 梨云梦暖 阅读(43) 评论(0) 推荐(0)
摘要: [leetcode-两数相加](https://leetcode-cn.com/problems/add-two-numbers/) >给你两个 非空 的链表,表示两个非负的整数。它们每位数字都是按照 逆序 的方式存储的,并且每个节点只能存储 一位 数字。 请你将两个数相加,并以相同形式返回一个表示 阅读全文
posted @ 2021-09-20 16:44 梨云梦暖 阅读(50) 评论(0) 推荐(0)
摘要: 其实不是忘记密码,是电脑系统安装补丁之后,重启电脑,然后我就无法连接我的mysql了。。。 好吧,接下来就是进入正题了 1.进入mysql的bin目录下,按住shift + 鼠标右键,点击打开“在此处打开Powershell窗口”; 依次输入 net stop mysql mysqld --cons 阅读全文
posted @ 2021-09-07 16:10 梨云梦暖 阅读(54) 评论(0) 推荐(0)
摘要: leetcode 1 两数之和 给定一个整数数组 nums 和一个整数目标值 target,请你在该数组中找出 和为目标值 target 的那 两个 整数,并返回它们的数组下标。 暴力求解:直接两重for循环 ``` class Solution { public int[] twoSum(int[ 阅读全文
posted @ 2021-07-17 20:25 梨云梦暖 阅读(55) 评论(0) 推荐(0)
摘要: [题目链接](https://leetcode-cn.com/problems/implement-stack-using-queues/ "题目链接") 题目描述: 请你仅使用两个队列实现一个后入先出(LIFO)的栈,并支持普通栈的全部四种操作(push、top、pop 和 empty)。 原题目 阅读全文
posted @ 2021-07-14 14:25 梨云梦暖 阅读(25) 评论(0) 推荐(0)
摘要: 977. 有序数组的平方 链接:[leetcode](https://leetcode-cn.com/problems/squares-of-a-sorted-array/ "leetcode") 给你一个按非递减顺序 排序的整数数组 nums,返回每个数字的平方组成的新数组,要求也按非递减顺序 排 阅读全文
posted @ 2021-07-03 11:47 梨云梦暖 阅读(59) 评论(0) 推荐(0)
摘要: 217. 存在重复元素 题目链接: [leetcode](https://leetcode-cn.com/problems/contains-duplicate/ "leetcode") 给定一个整数数组,判断是否存在重复元素。 如果存在一值在数组中出现至少两次,函数返回 true 。 如果数组中每 阅读全文
posted @ 2021-07-02 23:39 梨云梦暖 阅读(43) 评论(0) 推荐(0)
摘要: 704 二分查找 [leetcode](https://leetcode-cn.com/problems/binary-search/ "leetcode") 给定一个 n 个元素有序的(升序)整型数组 nums 和一个目标值 target, 写一个函数搜索 nums 中的 target,如果目标值 阅读全文
posted @ 2021-07-02 23:02 梨云梦暖 阅读(25) 评论(0) 推荐(0)