随笔分类 -  LeetCode

摘要:Move Zeroes题目:Given an array nums, write a function to move all 0‘s to the end of it while maintaining the relative order of the non-zero elements.For... 阅读全文
posted @ 2015-09-22 11:28 包子糖Sakura 阅读(750) 评论(0) 推荐(0)
摘要:Given a stringsconsists of upper/lower-case alphabets and empty space characters' ', return the length of last word in the string.If the last word doe... 阅读全文
posted @ 2015-07-09 17:34 包子糖Sakura 阅读(139) 评论(0) 推荐(0)
摘要:Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive integer... 阅读全文
posted @ 2015-07-05 13:38 包子糖Sakura 阅读(156) 评论(0) 推荐(0)
摘要:##Roman to Integer > Given a roman numeral, convert it to an integer.首先介绍罗马数字罗马数字共有七个,即I(1),V(5),X(10),L(50),C(100),D(500),M(1000)。按照下面的规则可以表示任意正整数。重复... 阅读全文
posted @ 2015-07-01 21:57 包子糖Sakura 阅读(1268) 评论(0) 推荐(0)
摘要:Longest Common PrefixWrite a function to find the longest common prefix string amongst an array of strings.题目的意图It seems that it is not to check betwe... 阅读全文
posted @ 2015-07-01 16:50 包子糖Sakura 阅读(161) 评论(0) 推荐(0)