上一页 1 ··· 8 9 10 11 12 13 14 15 下一页
摘要: Given a pattern and a string str, find if str follows the same pattern. Here follow means a full match, such that there is a bijection between a lette 阅读全文
posted @ 2016-09-14 12:27 Machelsky 阅读(402) 评论(0) 推荐(0)
摘要: Reverse bits of a given 32 bits unsigned integer. For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), retur 阅读全文
posted @ 2016-09-14 11:45 Machelsky 阅读(140) 评论(0) 推荐(0)
摘要: Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string. If the last word 阅读全文
posted @ 2016-09-14 11:23 Machelsky 阅读(126) 评论(0) 推荐(0)
摘要: Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the arr 阅读全文
posted @ 2016-09-14 08:51 Machelsky 阅读(157) 评论(0) 推荐(0)
摘要: Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array [-2,1,-3,4,-1,2, 阅读全文
posted @ 2016-09-13 15:16 Machelsky 阅读(102) 评论(0) 推荐(0)
摘要: Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. F 阅读全文
posted @ 2016-09-13 13:41 Machelsky 阅读(122) 评论(0) 推荐(0)
摘要: A message containing letters from A-Z is being encoded to numbers using the following mapping: Given an encoded message containing digits, determine t 阅读全文
posted @ 2016-09-13 13:06 Machelsky 阅读(156) 评论(0) 推荐(0)
摘要: Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -. Example:Given a = 1 and b = 2, return 3. 思路:xor相加存无car 阅读全文
posted @ 2016-09-13 11:24 Machelsky 阅读(104) 评论(0) 推荐(0)
摘要: Given two strings s and t, write a function to determine if t is an anagram of s. For example,s = "anagram", t = "nagaram", return true.s = "rat", t = 阅读全文
posted @ 2016-09-13 10:43 Machelsky 阅读(124) 评论(0) 推荐(0)
摘要: Given a singly linked list, determine if it is a palindrome. 思路:stack存数,然后从头比较。 Solution2: Follow up: O(n) in time, O(1) in space. 思路:用reverse linkedl 阅读全文
posted @ 2016-09-13 08:54 Machelsky 阅读(109) 评论(0) 推荐(0)
上一页 1 ··· 8 9 10 11 12 13 14 15 下一页