ToDo Ongoing Projects 1. Leetcode pre-200 Review Leetcode & Lintcode Leetcode 题解 (跟随思路一步一步撸出代码) 及经典算法实现:https://github.com/apachecn/awesome-algorithm ...
分类:
其他好文 时间:
2018-11-28 12:17:42
阅读次数:
240
题目描述: 给一包含大写字母和整数(从 0 到 9)的字符串, 试写一函数返回有序的字母以及数字和. 样例 给出 str = AC2BEW3, 返回 ABCEW5字母按字母表的顺序排列, 接着是整数的和(2 和 3). 分析 将string转成list进行分析,按照ascii码将list里面的元素分 ...
分类:
其他好文 时间:
2018-11-04 21:24:21
阅读次数:
162
单词接龙 II (来自lintecode:https://www.lintcode.com/problem/word-ladder-ii/?_from=ladder&&fromId=1) 给出两个单词(start和end)和一个字典,找出所有从start到end的最短转换序列。 变换规则如下: 1. ...
分类:
其他好文 时间:
2018-10-28 11:29:27
阅读次数:
152
lintcode91:最小调整代价给一个整数数组,调整每个数的大小,使得相邻的两个数的差不大于一个给定的整数target,调整每个数的代价为调整前后的差的绝对值,求调整代价之和最小是多少。例如:对于数组[1, 4, 2, 3]和target=1,最小的调整方案是调整为[2, 3, 2, 3],调整代 ...
分类:
编程语言 时间:
2018-09-19 22:06:38
阅读次数:
369
Description Given a sorted array of n integers, find the starting and ending position of a given target value. If the target is not found in the array ...
分类:
其他好文 时间:
2018-08-29 14:45:36
阅读次数:
127
拼多多笔试第三题 除了题目具体方法值得注意外,数据的输入格外注意 题目 描述 给n个人的朋友名单,告诉你user,请找出user最可能认识的人。(他和user有最多的共同好友且他不是user的朋友) n include include include using namespace std; int ...
分类:
其他好文 时间:
2018-08-12 23:40:58
阅读次数:
223
Alex and Lee play a game with piles of stones. There are an even number of piles arranged in a row, and each pile has a positive integer number of sto ...
分类:
其他好文 时间:
2018-08-01 11:39:10
阅读次数:
211
给定一个字符串s,将s分割成一些子串,使每个子串都是回文串。 返回s所有可能的回文串分割方案。 给定一个字符串s,将s分割成一些子串,使每个子串都是回文串。 返回s所有可能的回文串分割方案。 样例 给出 s = "aab",返回 [ [“aa”, “b”], [“a”, “a”, “b”] ] 分析 ...
分类:
其他好文 时间:
2018-07-31 15:20:58
阅读次数:
116
最近参加一个编程比赛,里面有个一些题库,这个题目就是其中之一. 当然,如果想锻炼自己的编程水平,可以去lintcode或者其他的网站上去刷题. 自信满满的我看到花了一个多小时才写出来,实在是汗颜. 本来实现使用string,毕竟是使用c++编程.没想好怎们写,就没有采用. 题目描述: 给定 2 个正 ...
分类:
编程语言 时间:
2018-07-29 16:26:36
阅读次数:
1205
原题网址:https://www.lintcode.com/problem/k-sum/description 描述 给定n个不同的正整数,整数k(k < = n)以及一个目标数字。 在这n个数里面找出K个数,使得这K个数的和等于目标数字,求问有多少种方案? 描述 描述 给定n个不同的正整数,整数k ...
分类:
其他好文 时间:
2018-07-28 23:25:23
阅读次数:
226