摘要: 题目: 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) 编辑