随笔分类 -  Math

摘要:Given a list of positive integers, the adjacent integers will perform the float division. For example, [2,3,4] -> 2 / 3 / 4. However, you can add any 阅读全文
posted @ 2019-04-20 22:12 Veritas_des_Liberty 阅读(191) 评论(0) 推荐(0)
摘要:Given an array of integers A, consider all non-empty subsequences of A. For any sequence S, let the width of S be the difference between the maximum a 阅读全文
posted @ 2019-04-09 21:41 Veritas_des_Liberty 阅读(304) 评论(0) 推荐(0)
摘要:Your are given an array of positive integers nums. Count and print the number of (contiguous) subarrays where the product of all the elements in the s 阅读全文
posted @ 2019-04-05 15:10 Veritas_des_Liberty 阅读(328) 评论(0) 推荐(0)
摘要:Given a non-negative integer, you could swap two digits at most once to get the maximum valued number. Return the maximum valued number you could get. 阅读全文
posted @ 2019-04-04 15:54 Veritas_des_Liberty 阅读(198) 评论(0) 推荐(0)
摘要:Given two integers n and k, you need to construct a list which contains n different positive integers ranging from 1 to n and obeys the following requ 阅读全文
posted @ 2019-04-04 14:05 Veritas_des_Liberty 阅读(186) 评论(0) 推荐(0)
摘要:Given an integer array, you need to find one continuous subarray that if you only sort this subarray in ascending order, then the whole array will be 阅读全文
posted @ 2019-04-02 22:33 Veritas_des_Liberty 阅读(206) 评论(0) 推荐(0)
摘要:Given an array of integers and an integer k, you need to find the total number of continuous subarrays whose sum equals to k. Example 1: Note: The len 阅读全文
posted @ 2019-04-02 10:27 Veritas_des_Liberty 阅读(175) 评论(0) 推荐(0)
摘要:Given an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements that appear twi 阅读全文
posted @ 2019-04-01 12:03 Veritas_des_Liberty 阅读(217) 评论(0) 推荐(0)
摘要:Given a string S, count the number of distinct, non-empty subsequences of S . Since the result may be large, return the answer modulo 10^9 + 7. Exampl 阅读全文
posted @ 2019-03-27 22:34 Veritas_des_Liberty 阅读(271) 评论(0) 推荐(0)
摘要:You have n super washing machines on a line. Initially, each washing machine has some dresses or is empty. For each move, you could choose any m (1 ≤ 阅读全文
posted @ 2019-03-07 18:28 Veritas_des_Liberty 阅读(216) 评论(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 @ 2019-02-16 22:24 Veritas_des_Liberty 阅读(193) 评论(0) 推荐(0)
摘要:Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary representation and r 阅读全文
posted @ 2019-02-16 21:47 Veritas_des_Liberty 阅读(186) 评论(0) 推荐(0)
摘要:Given an integer array nums, find the contiguous subarray within an array (containing at least one number) which has the largest product. Example 1: E 阅读全文
posted @ 2019-02-14 23:34 Veritas_des_Liberty 阅读(190) 评论(0) 推荐(0)
摘要:Given a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x < 10n. Example: Input: 2 Output: 91 Explanation: The answer shoul 阅读全文
posted @ 2019-02-05 23:32 Veritas_des_Liberty 阅读(258) 评论(0) 推荐(0)
摘要:Bholu the Pandit on this New Year wanted to divide his Cuboidal Packaging block into cubes. But he loves uniformity so he asks you to divide it such a 阅读全文
posted @ 2019-02-02 22:37 Veritas_des_Liberty 阅读(294) 评论(0) 推荐(0)
摘要:Write a program to find the nth super ugly number. Super ugly numbers are positive numbers whose all prime factors are in the given prime list primes  阅读全文
posted @ 2018-12-18 09:17 Veritas_des_Liberty 阅读(259) 评论(0) 推荐(0)
摘要:Write a program to find the n-th ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. Example: Input: n = 10 Outpu 阅读全文
posted @ 2018-12-17 21:06 Veritas_des_Liberty 阅读(181) 评论(0) 推荐(0)
摘要:We are given non-negative integers nums[i] which are written on a chalkboard. Alice and Bob take turns erasing exactly one number from the chalkboard, 阅读全文
posted @ 2018-11-17 16:36 Veritas_des_Liberty 阅读(239) 评论(0) 推荐(0)