上一页 1 ··· 44 45 46 47 48 49 50 51 52 ··· 76 下一页
摘要: Given a positive integer num, write a function which returns True if num is a perfect square else False. Note: Do not use any built in library functio 阅读全文
posted @ 2018-10-04 11:29 bernieloveslife 阅读(134) 评论(0) 推荐(0) 编辑
摘要: Find the nth digit of the infinite integer sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ... Note: n is positive and will fit within the range of a 32 b 阅读全文
posted @ 2018-10-04 11:29 bernieloveslife 阅读(92) 评论(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. Example 阅读全文
posted @ 2018-10-04 11:29 bernieloveslife 阅读(75) 评论(0) 推荐(0) 编辑
摘要: Given a list of non negative integers, arrange them such that they form the largest number. Example 1: Input: [10,2] Output: "210" Example 2: Input: [ 阅读全文
posted @ 2018-10-03 14:09 bernieloveslife 阅读(193) 评论(0) 推荐(0) 编辑
摘要: Given an unsorted array, find the maximum difference between the successive elements in its sorted form. Return 0 if the array contains less than 2 el 阅读全文
posted @ 2018-10-03 14:07 bernieloveslife 阅读(96) 评论(0) 推荐(0) 编辑
摘要: Given an integer n, return 1 n in lexicographical order. For example, given 13, return: [1,10,11,12,13,2,3,4,5,6,7,8,9]. Please optimize your algorith 阅读全文
posted @ 2018-10-03 14:06 bernieloveslife 阅读(93) 评论(0) 推荐(0) 编辑
摘要: International Morse Code defines a standard encoding where each letter is mapped to a series of dots and dashes, as follows: "a" maps to ". ", "b" map 阅读全文
posted @ 2018-10-03 14:06 bernieloveslife 阅读(110) 评论(0) 推荐(0) 编辑
摘要: In the "100 game," two players take turns adding, to a running total, any integer from 1..10. The player who first causes the running total to reach o 阅读全文
posted @ 2018-10-03 14:05 bernieloveslife 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 题目描述: 现有公园游船租赁处请你编写一个租船管理系统。当游客租船时,管理员输入船号并按下S键,系统开始计时;当游客还船时,管理员输入船号并按下E键,系统结束计时。船号为不超过100的正整数。当管理员将0作为船号输入时,表示一天租船工作结束,系统应输出当天的游客租船次数和平均租船时间。 注意:由于线 阅读全文
posted @ 2018-10-02 11:22 bernieloveslife 阅读(261) 评论(0) 推荐(0) 编辑
摘要: 统计一个给定字符串中指定的字符出现的次数。 测试输入包含若干测试用例,每个测试用例包含2行,第1行为一个长度不超过5的字符串,第2行为一个长度不超过80的字符串。注意这里的字符串包含空格,即空格也可能是要求被统计的字符之一。当读到'#'时输入结束,相应的结果不要输出。 对每个测试用例,统计第1行中字 阅读全文
posted @ 2018-10-02 11:21 bernieloveslife 阅读(225) 评论(0) 推荐(0) 编辑
上一页 1 ··· 44 45 46 47 48 49 50 51 52 ··· 76 下一页