![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
lintcode编程力培养
文章平均质量分 71
_忽如远行客
人一能之,已百之;人十能之,己千之.果能此道矣,虽愚必明,虽柔必强。
展开
-
[Medium]字符串最大匹配问题
Problem 6: For a given source string and a target string, you should output the first index(from 0) of target string in source string. If target does not exist in source, just return -1. 给出子串原创 2018-01-22 14:42:49 · 239 阅读 · 0 评论 -
简单二分法-First Position of Target
Problem 7: For a given sorted array (ascending order) and a targetnumber, find the first index of this number in O(log n) time complexity. If the target number does not exist in the array, r原创 2018-01-23 11:07:19 · 274 阅读 · 0 评论 -
[递归]Flattern List
Problem 7: Given a list, each element in the list can be a list or integer. flatten it into a simply list with integers. Example Given [1,2,[1,2]], return [1,2,1,2]. Given [4,[3,[2,[1]]]], r原创 2018-01-23 13:25:17 · 382 阅读 · 0 评论 -
A+B按位操作实现
Problem 1: Description: Write a function that add two numbers A and B. You should not use + or any arithmetic operators. a与b均为32位整数。不用加法运算符的话考虑按位计算。 首先 a+b如果有进位时,a+b = 不考虑进位时的运算结果+ 进位值 二进制加法若不原创 2018-01-20 11:38:46 · 1682 阅读 · 0 评论 -
有序数组结合问题-merge two sorted array
Problem 3: Merge two given sorted integer array A and B into a new sorted integer array. 解释: 两个有序数组A和B结合,要先自己声明一个数组C,C中的元素依次由A和B中元素比较得来,每个数组都要有记录当前位置的index。 (自己写的时候半天AC不了,用IDE调试发现是我初始化的问题,i原创 2018-01-20 20:44:14 · 279 阅读 · 0 评论 -
字符旋转问题-Rotate the string
Problem 4: Given a string and an offset, rotate string by offset. (rotate from left to right) Example Given "abcdefg". offset=0 => "abcdefg" offset=1 => "gabcdef" offset=2 => "fgabcde" offset=原创 2018-01-20 21:19:35 · 426 阅读 · 0 评论