
数学
景行cmy
这个作者很懒,什么都没留下…
展开
-
leetcode 335. Self Crossing
You are given an arrayxofnpositive numbers. You start at point(0,0)and movesx[0]metres to the north, thenx[1]metres to the west,x[2]metres to the south,x[3]metres to the east and so on. ...转载 2019-07-23 16:58:27 · 148 阅读 · 0 评论 -
leeetcode 1001. Grid Illumination
On a N x N grid of cells, each cell (x, y) with 0 <= x < N and 0 <= y < N has a lamp.Initially, some number of lamps are on. lamps[i] tells us the location of the i-th lamp that is on....原创 2019-09-18 19:08:58 · 163 阅读 · 0 评论 -
leetcode 906. Super Palindromes
Let's say a positive integer is asuperpalindromeif it is a palindrome, and it is also the square of a palindrome.Now, given two positiveintegers L and R (represented as strings), return the numbe...原创 2019-09-17 11:12:05 · 161 阅读 · 0 评论 -
leetcode 899. Orderly Queue
A string S of lowercase letters is given. Then, we may make any number of moves.In each move, wechoose oneof the first K letters (starting from the left), remove it,and place it at the end of th...原创 2019-09-16 12:01:32 · 246 阅读 · 0 评论 -
leetcode 891. Sum of Subsequence Widths
Given an array of integers A, consider all non-empty subsequences of A.For any sequence S, let thewidthof S be the difference between the maximum and minimum element of S.Return the sum of the w...原创 2019-09-15 20:28:47 · 163 阅读 · 0 评论 -
leetcode 829. Consecutive Numbers Sum
Given a positive integerN, how many ways can we write it as a sum ofconsecutive positive integers?Example 1:Input: 5Output: 2Explanation: 5 = 5 = 2 + 3Example 2:Input: 9Output: 3Explan...原创 2019-08-27 09:19:39 · 216 阅读 · 0 评论 -
leetcode 810. Chalkboard XOR Game
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, with Alice starting first. If erasing a number ...原创 2019-08-24 20:31:54 · 131 阅读 · 0 评论 -
leetcode 782. Transform to Chessboard
An N x Nboardcontains only0s and1s. In each move, you can swap any 2 rows with each other, or any 2 columns with each other.What is the minimum number of moves to transform the board into a "che...原创 2019-08-23 21:34:05 · 139 阅读 · 0 评论 -
leetcode 780. Reaching Points
A move consists of taking a point(x, y)and transforming it to either(x, x+y)or(x+y, y).Given a starting point(sx, sy)and a target point(tx, ty), returnTrueif and only if a sequence of moves...原创 2019-08-23 17:40:55 · 122 阅读 · 0 评论 -
leetcode 440. K-th Smallest in Lexicographical Order
Given integersnandk, find the lexicographically k-th smallest integer in the range from1ton.Note: 1 ≤ k ≤ n ≤ 109.Example:Input:n: 13 k: 2Output:10Explanation:The lexicographical...原创 2019-08-08 13:21:54 · 101 阅读 · 0 评论 -
leetcode 233. Number of Digit One
Given an integer n, count the total number of digit 1 appearing in all non-negative integers less than or equal to n.Example:Input: 13Output: 6 Explanation: Digit 1 occurred in the following nu...原创 2019-07-23 11:41:26 · 94 阅读 · 0 评论 -
leetcode 458. Poor Pigs
There are 1000 buckets, one and only one of them is poisonous, while the rest are filled with water. They all look identical. If a pig drinks the poison it will die within 15 minutes. What is the mini...原创 2019-07-24 08:21:32 · 111 阅读 · 0 评论 -
leetcode 1088. Confusing Number II
We can rotate digits by 180 degrees to form new digits. When 0, 1, 6, 8, 9 are rotated 180 degrees, they become 0, 1, 9, 8, 6 respectively. When 2, 3, 4, 5 and 7 are rotated 180 degrees, they become i...原创 2019-10-10 14:43:30 · 9908 阅读 · 0 评论