2020年4月29日

git添加ssh公钥报错

摘要: 我使用的是ubuntu。 首先生成密钥对:ssh-keygen 然后讲公钥输出到终端:cat .ssh/id_rsa.pub 最后将终端里的文本密钥复制到git的textbox里。 此时,报错,说是无效密钥。 解决方法: 生成密钥对后,使用命令 more .ssh/id_rsa.pub 再将终端的密 阅读全文

posted @ 2020-04-29 11:30 JASONlee3 阅读(375) 评论(0) 推荐(0) 编辑

2020年4月19日

leetcode_1187. Make Array Strictly Increasing 使数组严格递增_[DP]

摘要: 给你两个整数数组 arr1 和 arr2,返回使 arr1 严格递增所需要的最小「操作」数(可能为 0)。 每一步「操作」中,你可以分别从 arr1 和 arr2 中各选出一个索引,分别为 i 和 j,0 <= i < arr1.length 和 0 <= j < arr2.length,然后进行赋 阅读全文

posted @ 2020-04-19 23:36 JASONlee3 阅读(307) 评论(0) 推荐(0) 编辑

2019年12月15日

leetcode_1293. Shortest Path in a Grid with Obstacles Elimination_[dp动态规划]

摘要: 题目链接 Given a m * n grid, where each cell is either 0 (empty) or 1 (obstacle). In one step, you can move up, down, left or right from and to an empty c 阅读全文

posted @ 2019-12-15 22:55 JASONlee3 阅读(498) 评论(0) 推荐(0) 编辑

leetcode_1292. Maximum Side Length of a Square with Sum Less than or Equal to Threshold_[二维前缀和]

摘要: 题目链接 Given a m x n matrix mat and an integer threshold. Return the maximum side-length of a square with a sum less than or equal to threshold or retur 阅读全文

posted @ 2019-12-15 22:48 JASONlee3 阅读(368) 评论(0) 推荐(0) 编辑

2019年12月3日

Leetcode_1278. Palindrome Partitioning III_[DP]

摘要: 题目链接 You are given a string s containing lowercase letters and an integer k. You need to : First, change some characters of s to other lowercase Engli 阅读全文

posted @ 2019-12-03 16:12 JASONlee3 阅读(255) 评论(0) 推荐(0) 编辑

2019年12月2日

Leetcode_132. Palindrome Partitioning II_[DP]

摘要: 题目链接 Given a string s, partition s such that every substring of the partition is a palindrome. Return the minimum cuts needed for a palindrome partiti 阅读全文

posted @ 2019-12-02 21:42 JASONlee3 阅读(149) 评论(0) 推荐(0) 编辑

Leetcode_131. Palindrome Partitioning_[DFS]

摘要: 题目链接 Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. Examp 阅读全文

posted @ 2019-12-02 21:29 JASONlee3 阅读(220) 评论(0) 推荐(0) 编辑

2019年11月27日

Leetcode_395. Longest Substring with At Least K Repeating Characters_[Devide and Conquer]

摘要: 题目链接 对一个字符串,找出一个最长的子串长度,这个子串中所有字符出现的次数至少为k。 1.滑动窗口 一开始把题目看成了,子串中每个字符至多出现k次。如果是这样,那么是一道典型的滑动窗口的题目。 然而,题目是至少出现k次。这样一来,滑动窗口不再适用。因为,在字符出现至多k次的问题中,当窗口尾部的字符 阅读全文

posted @ 2019-11-27 21:51 JASONlee3 阅读(228) 评论(0) 推荐(0) 编辑

2019年11月5日

Slide Window 专题

摘要: 209. Minimum Size Subarray Sum 给定正整数数组和正整数s,找到加和大于等于s的连续子数组的最小长度。 基础slide window题目。 class Solution { public: int minSubArrayLen(int s, vector<int>& nu 阅读全文

posted @ 2019-11-05 15:27 JASONlee3 阅读(764) 评论(0) 推荐(0) 编辑

2019年8月13日

codeforces_D. Treasure Hunting_[DP+Binary Search]

摘要: http://codeforces.com/contest/1201/problem/D 题意:n行m列的矩阵中,有k个targets,从[1, 1]出发,每次只能向上下左右四个方向移动一步,且只有在q个safecolumns上进行向上移动,最少需要多少次移动才能获得所有的targets。(2≤n, 阅读全文

posted @ 2019-08-13 18:39 JASONlee3 阅读(313) 评论(0) 推荐(0) 编辑

导航