上一页 1 2 3 4 5 6 7 ··· 15 下一页
摘要: Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. 思路:对应检查char是否一样,不一样直接跳出检 阅读全文
posted @ 2016-10-10 07:19 Machelsky 阅读(313) 评论(0) 推荐(0)
摘要: Write a function that takes a string as input and reverse only the vowels of a string. Example 1:Given s = "hello", return "holle". Example 2:Given s 阅读全文
posted @ 2016-10-10 07:04 Machelsky 阅读(144) 评论(0) 推荐(0)
摘要: 160. Intersection of Two Linked Lists 1.各自扫一遍list找到第一个相同节点 2.各自扫一遍,记录长度。将长的缩小到跟短的一样,相同长度的情况下找同节点。 136. Single Number: A^0=A A^A=0 最后留下A 阅读全文
posted @ 2016-10-10 06:55 Machelsky 阅读(84) 评论(0) 推荐(0)
摘要: Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example,"A man, a plan, a canal: Pan 阅读全文
posted @ 2016-10-10 06:24 Machelsky 阅读(105) 评论(0) 推荐(0)
摘要: Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which the leng 阅读全文
posted @ 2016-10-10 06:02 Machelsky 阅读(110) 评论(0) 推荐(0)
摘要: Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1. Examples: 阅读全文
posted @ 2016-10-10 05:35 Machelsky 阅读(135) 评论(0) 推荐(0)
摘要: Given a binary tree, return the postorder traversal of its nodes' values. For example:Given binary tree {1,#,2,3}, return [3,2,1]. 思路:后序遍历 阅读全文
posted @ 2016-10-09 10:31 Machelsky 阅读(132) 评论(0) 推荐(0)
摘要: Given a binary tree, return the inorder traversal of its nodes' values. For example:Given binary tree [1,null,2,3], return [1,3,2]. 思路:中序遍历。 阅读全文
posted @ 2016-10-09 10:26 Machelsky 阅读(106) 评论(0) 推荐(0)
摘要: Given a binary tree, return the preorder traversal of its nodes' values. For example:Given binary tree {1,#,2,3}, return [1,2,3]. Note: Recursive solu 阅读全文
posted @ 2016-10-09 10:17 Machelsky 阅读(101) 评论(0) 推荐(0)
摘要: Compare two version numbers version1 and version2.If version1 > version2 return 1, if version1 < version2 return -1, otherwise return 0. You may assum 阅读全文
posted @ 2016-10-09 10:01 Machelsky 阅读(170) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 ··· 15 下一页