
leetcode
文章平均质量分 64
菜鸟程序猿的滴滴日常
关注:机器学习,数据挖掘,深度学习,自然语言处理。
展开
-
【LintCode】637. 检查缩写字(熟悉字符串)
描述中文English给定一个非空字符串word和缩写abbr,返回字符串是否可以和给定的缩写匹配。比如一个“word”的字符串仅包含以下有效缩写:["word", "1ord", "w1rd", "wo1d", "wor1", "2rd", "w2d", "wo2", "1o1d", "1or1", "w1r1", "1o2", "2r1", "3d", "w3", "4"]样例样例 1:输入 : s = "internationalization", abbr =...原创 2020-05-20 22:48:17 · 480 阅读 · 0 评论 -
二分查找【LeetCode】
当数组有序,可以考虑二分查找,栗子:public int search(int key, int[] array) { int left = 0; int right = array.length - 1; while(left <= right) { int mid = left + (right - left) / 2; ...原创 2020-05-18 22:25:23 · 166 阅读 · 0 评论 -
leetcode(383. Ransom Note)
#383. Ransom NoteGiven an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the ransom note can be constructed from th原创 2017-10-19 21:06:57 · 309 阅读 · 0 评论 -
LeetCode:60. Permutation Sequence
LeetCode: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 (ie, for原创 2017-11-01 21:54:08 · 285 阅读 · 0 评论