摘要: 题目: Write a function that takes a string as input and returns the string reversed. Example: Given s = "hello", return "olleh". 解答:这个题目超级无敌简单,就是把一个stri 阅读全文
posted @ 2016-04-22 16:48 CodingGirl121 阅读(107) 评论(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 阅读全文
posted @ 2016-04-21 19:01 CodingGirl121 阅读(140) 评论(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 occur 阅读全文
posted @ 2016-04-21 17:03 CodingGirl121 阅读(99) 评论(0) 推荐(0) 编辑
摘要: 题目:Given an integer, write a function to determine if it is a power of three. Follow up: Could you do it without using any loop / recursion? 题目解答:本题是不 阅读全文
posted @ 2016-04-21 16:43 CodingGirl121 阅读(109) 评论(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 stoppin 阅读全文
posted @ 2016-04-20 21:24 CodingGirl121 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a sorted linked list, delete all duplicates such that each element appear only once. For example, Given 1->1->2, return 1->2. Given 1->1->2-> 阅读全文
posted @ 2016-04-20 21:04 CodingGirl121 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. According to the definition of LCA on Wikipe 阅读全文
posted @ 2016-04-20 20:37 CodingGirl121 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 题目:Write a program to check whether a given number is an ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For 阅读全文
posted @ 2016-04-20 19:25 CodingGirl121 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 题目: Remove all elements from a linked list of integers that have value val. ExampleGiven: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6Return: 1 --> 阅读全文
posted @ 2016-04-20 19:15 CodingGirl121 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 题目:The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ... 1 is read off as "one 1" or 11.11 is read 阅读全文
posted @ 2016-04-20 19:03 CodingGirl121 阅读(111) 评论(0) 推荐(0) 编辑