bigpotato

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2018年3月26日

摘要: A sequence of number is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the 阅读全文
posted @ 2018-03-26 19:37 bigpotato 阅读(132) 评论(0) 推荐(0)

2018年3月23日

摘要: 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-bi 阅读全文
posted @ 2018-03-23 18:09 bigpotato 阅读(105) 评论(0) 推荐(0)

摘要: Given a positive integer n and you can do operations as follow: If n is even, replace n with n/2. If n is odd, you can replace n with either n + 1 or  阅读全文
posted @ 2018-03-23 15:29 bigpotato 阅读(112) 评论(0) 推荐(0)

摘要: Given an array of integers A and let n to be its length. Assume Bk to be an array obtained by rotating the array A k positions clock-wise, we define a 阅读全文
posted @ 2018-03-23 14:18 bigpotato 阅读(176) 评论(0) 推荐(0)

摘要: Your task is to calculate ab mod 1337 where a is a positive integer and b is an extremely large positive integer given in the form of an array. Exampl 阅读全文
posted @ 2018-03-23 11:05 bigpotato 阅读(164) 评论(0) 推荐(0)

摘要: Given a set of distinct positive integers, find the largest subset such that every pair (Si, Sj) of elements in this subset satisfies: Si % Sj = 0 or 阅读全文
posted @ 2018-03-23 09:04 bigpotato 阅读(210) 评论(0) 推荐(0)

2018年3月22日

摘要: 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-03-22 11:45 bigpotato 阅读(168) 评论(0) 推荐(0)

摘要: You are given two jugs with capacities x and y litres. There is an infinite amount of water supply available. You need to determine whether it is poss 阅读全文
posted @ 2018-03-22 10:15 bigpotato 阅读(141) 评论(0) 推荐(0)

2018年3月20日

摘要: Given a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x < 10n. Example:Given n = 2, return 91. (The answer should be the 阅读全文
posted @ 2018-03-20 15:44 bigpotato 阅读(127) 评论(0) 推荐(0)

摘要: Given a positive integer n, break it into the sum of at least two positive integers and maximize the product of those integers. Return the maximum pro 阅读全文
posted @ 2018-03-20 14:29 bigpotato 阅读(118) 评论(0) 推荐(0)