摘要: 题目如下。~Given an arraynums, write a function to move all0's to the end of it while maintaining the relative order of the non-zero elements.For example, ... 阅读全文
posted @ 2015-10-10 02:38 李小橘er 阅读(112) 评论(0) 推荐(0)
摘要: 题目如下。~Given apatternand a stringstr, find ifstrfollows the same pattern.Examples:pattern ="abba", str ="dog cat cat dog"should return true.pattern ="a... 阅读全文
posted @ 2015-10-10 00:05 李小橘er 阅读(228) 评论(0) 推荐(0)
摘要: Given a stringsand a dictionary of wordsdict, determine ifscan be segmented into a space-separated sequence of one or more dictionary words.For exampl... 阅读全文
posted @ 2015-09-12 18:01 李小橘er 阅读(239) 评论(0) 推荐(0)
摘要: Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric: 1 / \ ... 阅读全文
posted @ 2015-08-26 15:51 李小橘er 阅读(163) 评论(-1) 推荐(0)
摘要: Given two stringssandt, determine if they are isomorphic.Two strings are isomorphic if the characters inscan be replaced to gett.All occurrences of a ... 阅读全文
posted @ 2015-08-26 11:11 李小橘er 阅读(228) 评论(0) 推荐(0)
摘要: Given a linked list, swap every two adjacent nodes and return its head.For example,Given1->2->3->4, you should return the list as2->1->4->3.Your algor... 阅读全文
posted @ 2015-08-26 10:28 李小橘er 阅读(318) 评论(0) 推荐(0)
摘要: Given a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The brackets must close in the correct ... 阅读全文
posted @ 2015-08-24 15:06 李小橘er 阅读(188) 评论(0) 推荐(0)
摘要: Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999. 这道题主要要搞清楚Roman变成Integer的算法。 记得如果一个数比前面一个数... 阅读全文
posted @ 2015-08-24 13:53 李小橘er 阅读(167) 评论(0) 推荐(0)
摘要: After robbing those houses on that street, the thief has found himself a new place for his thievery so that he will not get too much attention. This t... 阅读全文
posted @ 2015-08-24 11:32 李小橘er 阅读(184) 评论(0) 推荐(0)
摘要: You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping yo... 阅读全文
posted @ 2015-08-24 10:30 李小橘er 阅读(255) 评论(0) 推荐(0)