码迷,mamicode.com
首页 >  
搜索关键字:lintcode    ( 1584个结果
LintCode 第一题fizz buzz
【题目】给你一个整数n.从1到n按照下面的规则打印每个数:如果这个数被3整除,打印fizz如果这个数被5整除,打印buzz如果这个数能同时被3和5整除,打印fizzbuzz样例比如n=15,返回一个字符串数组:["1","2","fizz","4","buzz","fizz","7","8","fizz","buzz","11","fizz","13","14..
分类:其他好文   时间:2015-03-15 07:11:49    阅读次数:139
Lintcode: Maximum Subarray III
Given an array of integers and a number k, find k non-overlapping subarrays which have the largest sum.The number in each subarray should be contiguou...
分类:其他好文   时间:2015-03-14 12:16:06    阅读次数:198
Lintcode: Maximum Subarray Difference
Given an array with integers.Find two non-overlapping subarrays A and B, which |SUM(A) - SUM(B)| is the largest.Return the largest difference.NoteThe ...
分类:其他好文   时间:2015-03-14 06:11:46    阅读次数:565
Lintcode: Maximum Subarray II
Given an array of integers, find two non-overlapping subarrays which have the largest sum.The number in each subarray should be contiguous.Return the ...
分类:其他好文   时间:2015-03-14 06:10:35    阅读次数:198
Lintcode: Majority Number II
Given an array of integers, the majority number is the number that occurs more than 1/3 of the size of the array.Find it.NoteThere is only one majorit...
分类:其他好文   时间:2015-03-12 07:30:15    阅读次数:137
Lintcode: Lowest Common Ancestor
Given the root and two nodes in a Binary Tree. Find the lowest common ancestor(LCA) of the two nodes.The lowest common ancestor is the node with large...
分类:其他好文   时间:2015-03-12 06:25:09    阅读次数:117
Lintcode: Longest Common Substring
Given two strings, find the longest common substring.Return the length of it.NoteThe characters in substring should occur continiously in original str...
分类:其他好文   时间:2015-03-09 12:17:48    阅读次数:105
Lintcode: Longest Common Subsequence
Given two strings, find the longest comment subsequence (LCS).Your code should return the length of LCS.ExampleFor "ABCD" and "EDCA", the LCS is "A" (...
分类:其他好文   时间:2015-03-09 09:20:00    阅读次数:141
Lintcode: Kth Prime Number
Design an algorithm to find the kth number such that the only prime factors are 3, 5, and 7.The eligible numbers are like 3, 5, 7, 9, 15 ...ExampleIf ...
分类:其他好文   时间:2015-03-09 07:01:19    阅读次数:183
Lintcode: Kth largest Element
Find K-th largest element in an array.NoteYou can swap elements in the arrayExampleIn array [9,3,2,4,8], the 3rd largest element is 4In array [1,2,3,4...
分类:其他好文   时间:2015-03-09 07:01:05    阅读次数:181
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!