- 博客(11)
- 资源 (2)
- 收藏
- 关注
原创 LeetCode—389. Find the Difference
Find the Difference思路:建立一个长度26的数组,循环字符串s和t即可。GitHub地址:https://github.com/corpsepiges/leetcode点此进入如果可以的话,请点一下star,谢谢。public class Solution { public char findTheDifference(
2016-08-29 10:01:48 721
原创 LeetCode—388. Longest Absolute File Path
Longest Absolute File Path思路:非常恶心的题目,测试样例提供一个不从某个目录开始,而是从多个目录开始的样例。。题目很简单,注意各种奇怪的案例即可。GitHub地址:https://github.com/corpsepiges/leetcode点此进入如果可以的话,请点一下star,谢谢。public cl
2016-08-22 17:48:09 1409
原创 LeetCode—387. First Unique Character in a String
First Unique Character in a String思路:非常简单,一个list存,一个map记录下标。GitHub地址:https://github.com/corpsepiges/leetcode点此进入如果可以的话,请点一下star,谢谢。public class Solution { public int fi
2016-08-22 15:35:48 581
原创 LeetCode—386. Lexicographical Numbers
Lexicographical Numbers思路:最直观的思路就是分治,但是太无趣了。直接上计数。把每个数当做11进制来看,先确定好数的范围,根据n可以知道最大为k位数,然后把每个数都转成11进制,不足k位的后面补x补齐。每个位置上面,x表示0,其他10个数字表示自身+1,这是一个11进制,然后转化成10进制即可知道位置。GitHub地址:https:
2016-08-22 15:05:31 1805
原创 LeetCode—385. Mini Parser
Mini Parser思路:1.首先根据是否有括号判定是否为纯数字,如果是纯数字则直接转化。2其次判断list是否为空,为空直接转化。3.统计左右括号是否对应,如果对应,则遇到逗号后递归处理,无论是list还是纯数字。GitHub地址:https://github.com/corpsepiges/leetcode目前java版本的答案大约进度是免费的差40题,p
2016-08-15 11:25:31 2410
原创 LeetCode—384. Shuffle an Array
Shuffle an Array思路:随机化下标。然后重新获取值。GitHub地址:https://github.com/corpsepiges/leetcode目前java版本的答案大约进度是免费的差40题,python大约是一半,其他的等以后再补充。点此进入如果可以的话,请点一下star,谢谢。public class Sol
2016-08-12 11:29:47 1846
原创 LeetCode—383. Ransom Note
Linked List Random Node思路:拆解成char,然后统计所有的char个数GitHub地址:https://github.com/corpsepiges/leetcode目前java版本的答案大约进度是免费的差40题,python大约是一半,其他的等以后再补充。点此进入如果可以的话,请点一下star,谢谢。publ
2016-08-12 11:16:05 579
原创 LeetCode—382. Linked List Random Node
Linked List Random Node思路:常数空间求随机元素,显然不能用队列存储,那么利用公式第i个元素取到的概率等于 1/i,他被保留的概率等于 1/i*(i/(1+i))*.......*(n-1/n)=1/nGitHub地址:https://github.com/corpsepiges/leetcode目前java版本的答案大约进度是免
2016-08-12 10:55:58 1031
原创 LeetCode—381. Insert Delete GetRandom O(1) - Duplicates allowed
Insert Delete GetRandom O(1) - Duplicates allowed 思路:java中的list提供了针对制定元素删除的方法以及判断该元素是否存在的方法GitHub地址:https://github.com/corpsepiges/leetcode目前java版本的答案大约进度是免费的差40题,python大约是一半,其他的等以后再
2016-08-09 10:18:00 1035 2
原创 LeetCode—380. Insert Delete GetRandom O(1)s
Insert Delete GetRandom O(1)思路:java中的list提供了针对制定元素删除的方法以及判断该元素是否存在的方法GitHub地址:https://github.com/corpsepiges/leetcode目前java版本的答案大约进度是免费的差40题,python大约是一半,其他的等以后再补充。点此进入如果可以的话,请点一下st
2016-08-08 15:08:20 847
原创 LeetCode—378. Kth Smallest Element in a Sorted Matrix
Kth Smallest Element in a Sorted Matrix思路:1.首先这题把所有的数组遍历出来然后直接排序就可以AC..... 2.正常思路就是维系最大堆。GitHub地址:https://github.com/corpsepiges/leetcode目前java版本的答案大约进度是免费的差40题,python大约是一半,其他的等以后再补充。
2016-08-02 10:20:37 3040
2积分系列——经典算法与人工智能在外卖物流调度中的应用
2018-04-26
Outlier Analysis 2nd Edition.pdf ——2积分系列
2018-03-28
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人