摘要: Numbers can be regarded as product of its factors. For example, Write a function that takes an integer n and return all possible combinations of its f 阅读全文
posted @ 2016-09-14 14:26 LiBlog 阅读(233) 评论(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 阅读全文
posted @ 2016-09-14 07:05 LiBlog 阅读(139) 评论(0) 推荐(0) 编辑
摘要: Given a string, we can "shift" each of its letter to its successive letter, for example: "abc" -> "bcd". We can keep "shifting" which forms the sequen 阅读全文
posted @ 2016-09-14 06:50 LiBlog 阅读(189) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return all root-to-leaf paths. For example, given the following binary tree: All root-to-leaf paths are: Credits:Special thanks t 阅读全文
posted @ 2016-09-14 05:51 LiBlog 阅读(136) 评论(0) 推荐(0) 编辑
摘要: You are playing the following Bulls and Cows game with your friend: You write down a number and ask your friend to guess what the number is. Each time 阅读全文
posted @ 2016-09-14 05:41 LiBlog 阅读(217) 评论(0) 推荐(0) 编辑
摘要: Given two strings s and t, determine if they are isomorphic. Two strings are isomorphic if the characters in s can be replaced to get t. All occurrenc 阅读全文
posted @ 2016-09-14 04:49 LiBlog 阅读(145) 评论(0) 推荐(0) 编辑
摘要: Implement the following operations of a queue using stacks. push(x) -- Push element x to the back of queue. pop() -- Removes the element from in front 阅读全文
posted @ 2016-09-14 02:38 LiBlog 阅读(118) 评论(0) 推荐(0) 编辑
摘要: Implement the following operations of a stack using queues. push(x) -- Push element x onto stack. pop() -- Removes the element on top of the stack. to 阅读全文
posted @ 2016-09-14 02:00 LiBlog 阅读(110) 评论(0) 推荐(0) 编辑
摘要: Description: Count the number of prime numbers less than a non-negative number, n. Credits:Special thanks to @mithmatt for adding this problem and cre 阅读全文
posted @ 2016-09-14 01:15 LiBlog 阅读(159) 评论(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 00:34 LiBlog 阅读(110) 评论(0) 推荐(0) 编辑