上一页 1 2 3 4 5 6 7 8 9 10 ··· 46 下一页
  2018年2月28日
摘要: 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 @ 2018-02-28 19:34 Beserious 阅读(80) 评论(0) 推荐(0) 编辑
摘要: You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality c 阅读全文
posted @ 2018-02-28 19:33 Beserious 阅读(88) 评论(0) 推荐(0) 编辑
摘要: Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. 前缀和思想。如果修改的次数比较多,那么就可以用线段树了, class NumArray { pu 阅读全文
posted @ 2018-02-28 19:29 Beserious 阅读(79) 评论(0) 推荐(0) 编辑
摘要: Given an integer, write a function to determine if it is a power of three. 判断一个数,是不是3的n次幂。直接换底公式求解 阅读全文
posted @ 2018-02-28 19:22 Beserious 阅读(85) 评论(0) 推荐(0) 编辑
摘要: Given two arrays, write a function to compute their intersection. Example: Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2, 2]. Note: Each eleme 阅读全文
posted @ 2018-02-28 19:07 Beserious 阅读(95) 评论(0) 推荐(0) 编辑
摘要: Calculate the sum of two integers a and b, but you are not allowed to use the operator + and . Example: Given a = 1 and b = 2, return 3. 不用加减法进行求和运算。 阅读全文
posted @ 2018-02-28 19:03 Beserious 阅读(102) 评论(0) 推荐(0) 编辑
摘要: Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. Supposed the linked list is 1 2 3 4 and y 阅读全文
posted @ 2018-02-28 18:25 Beserious 阅读(81) 评论(0) 推荐(0) 编辑
摘要: 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-02-28 18:23 Beserious 阅读(121) 评论(0) 推荐(0) 编辑
摘要: Given a singly linked list, determine if it is a palindrome. Follow up: Could you do it in O(n) time and O(1) space? 判断一个链表是不是回文的。 思路:遍历节点得到总数tot,然后反转 阅读全文
posted @ 2018-02-28 18:21 Beserious 阅读(104) 评论(0) 推荐(0) 编辑
摘要: Implement the following operations of a queue using stacks. push(x) Push element x to the back of queue. pop() Removes the element from in front of qu 阅读全文
posted @ 2018-02-28 18:16 Beserious 阅读(130) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 46 下一页