摘要: Given a collection of distinct numbers, return all possible permutations. For example,[1,2,3] have the following permutations: Backtracking is a more 阅读全文
posted @ 2016-09-14 16:39 Machelsky 阅读(131) 评论(0) 推荐(0)
摘要: 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 阅读(404) 评论(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 阅读(143) 评论(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 阅读(128) 评论(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 阅读(161) 评论(0) 推荐(0)