Fork me on GitHub
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 37 下一页
摘要: 给定一个字符串S和有效单词的字典D,请确定可以插入到S中的最小空格数,使得最终的字符串完全由D中的有效单词组成。并输出解。 如果没有解则应该输出n/a 例如: 输入: S = “ilikealibaba” D = {"i","like","ali","liba","baba","alibaba"} 阅读全文
posted @ 2017-08-25 22:16 hellowOOOrld 阅读(358) 评论(0) 推荐(0)
摘要: 1. 猎人把一对兔子婴儿(一公一母称为一对)放到一个荒岛上,两年之后,它们生下一对小兔,之后开始每年都会生下一对小兔。生下的小兔又会以同样的方式继续繁殖。 2. 兔子的寿命都是x(x>=3)年,并且生命的最后一年不繁殖。 3. 如果岛上的兔子多于10对,那么猎人会每年在兔子们完成繁殖或者仙逝之后,从 阅读全文
posted @ 2017-08-21 21:35 hellowOOOrld 阅读(1115) 评论(0) 推荐(0)
摘要: 题目: 给定一个包含1-n的数列,我们通过交换任意两个元素给数列重新排序。 求最少需要多少次交换,能把数组排成按1-n递增的顺序,(数组中的元素互不重复)。 比如 初始状态 5 4 3 2 1 。交换5和1的位置 得到 1 4 3 2 5,再交换4 2的位置得到 1 2 3 4 5.只需要两次即可。 阅读全文
posted @ 2017-08-20 22:06 hellowOOOrld 阅读(17743) 评论(7) 推荐(2)
摘要: Given a 2D integer matrix M representing the gray scale of an image, you need to design a smoother to make the gray scale of each cell becomes the ave 阅读全文
posted @ 2017-08-20 11:29 hellowOOOrld 阅读(373) 评论(0) 推荐(0)
摘要: Given a binary tree, write a function to get the maximum width of the given tree. The width of a tree is the maximum width among all levels. The binar 阅读全文
posted @ 2017-08-20 11:23 hellowOOOrld 阅读(244) 评论(0) 推荐(0)
摘要: Given a binary tree with n nodes, your task is to check if it's possible to partition the tree to two trees which have the equal sum of values after r 阅读全文
posted @ 2017-08-20 11:12 hellowOOOrld 阅读(616) 评论(0) 推荐(0)
摘要: 转载自:http://blog.csdn.net/qq_14935437/article/details/71081546 OSI模型,即开放式通信系统互联参考模型(Open System Interconnection,OSI/RM,Open Systems InterconnectionRefe 阅读全文
posted @ 2017-08-19 19:28 hellowOOOrld 阅读(1596) 评论(0) 推荐(0)
摘要: 一些容易记混的c++相关知识。 截图自:《王道程序员面试宝典》 阅读全文
posted @ 2017-08-16 21:29 hellowOOOrld 阅读(175) 评论(0) 推荐(0)
摘要: Given a sorted array, two integers k and x, find the k closest elements to x in the array. The result should also be sorted in ascending order. If the 阅读全文
posted @ 2017-08-13 11:12 hellowOOOrld 阅读(411) 评论(0) 推荐(0)
摘要: Initially, there is a Robot at position (0, 0). Given a sequence of its moves, judge if this robot makes a circle, which means it moves back to the or 阅读全文
posted @ 2017-08-13 11:01 hellowOOOrld 阅读(932) 评论(0) 推荐(0)
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 37 下一页