摘要: 写在前面,参考的力扣官网题解的解法三,自己用画图的形式解析了这个解法 二分 ##一、java代码 /* * @lc app=leetcode.cn id=4 lang=java * * [4] 寻找两个正序数组的中位数 */ // @lc code=start class Solution { pu 阅读全文
posted @ 2020-08-05 20:34 阿狸狸爱吃饭 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 写在前面,参考的力扣官网的画解算法 滑动窗口 class Solution { public int lengthOfLongestSubstring(String s) { //定义字符串长度,距离 int n=s.length(),ans=0; //用什么装start指针 //定义一个map数据 阅读全文
posted @ 2020-08-05 12:06 阿狸狸爱吃饭 阅读(45) 评论(0) 推荐(0) 编辑
摘要: 写在前面,参考的力扣官网的画解算法 链表 /* * @lc app=leetcode.cn id=2 lang=java * * [2] 两数相加 */ // @lc code=start /** * Definition for singly-linked list. * public class 阅读全文
posted @ 2020-08-05 11:02 阿狸狸爱吃饭 阅读(36) 评论(0) 推荐(0) 编辑
摘要: 写在前面,参考的力扣官网的画解算法 #hash映射 /* * @lc app=leetcode.cn id=1 lang=java * * [1] 两数之和 */ // @lc code=start class Solution { public int[] twoSum(int[] nums, i 阅读全文
posted @ 2020-08-05 10:59 阿狸狸爱吃饭 阅读(61) 评论(0) 推荐(0) 编辑