摘要: 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 exa 阅读全文
posted @ 2016-03-22 15:16 白天黑夜每日c 阅读(105) 评论(0) 推荐(0) 编辑
摘要: You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you cl 阅读全文
posted @ 2016-03-22 15:12 白天黑夜每日c 阅读(127) 评论(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->3->3, 阅读全文
posted @ 2016-03-22 14:54 白天黑夜每日c 阅读(110) 评论(0) 推荐(0) 编辑
摘要: Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the 阅读全文
posted @ 2016-03-22 14:48 白天黑夜每日c 阅读(122) 评论(0) 推荐(0) 编辑
摘要: Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. 阅读全文
posted @ 2016-03-22 09:38 白天黑夜每日c 阅读(131) 评论(0) 推荐(0) 编辑
摘要: Reverse a singly linked list. 之前错误: 把p->next=head; 写成 ln->next=head; ln是返回链表的头指针 阅读全文
posted @ 2016-03-21 14:58 白天黑夜每日c 阅读(112) 评论(0) 推荐(0) 编辑
摘要: Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assume that the 阅读全文
posted @ 2016-03-21 14:41 白天黑夜每日c 阅读(140) 评论(2) 推荐(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-03-21 14:23 白天黑夜每日c 阅读(134) 评论(0) 推荐(0) 编辑
摘要: Given a column title as appear in an Excel sheet, return its corresponding column number. For example: A的ascii: 65 阅读全文
posted @ 2016-03-21 10:25 白天黑夜每日c 阅读(118) 评论(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-03-21 10:08 白天黑夜每日c 阅读(109) 评论(0) 推荐(0) 编辑