- 博客(17)
- 收藏
- 关注
原创 LeetCode478. Generate Random Point in a Circle
Given the radius and x-y positions of the center of a circle, write a functionrandPointwhichgenerates a uniform randompoint in the circle.Note:input and output values areinfloating-point. r...
2020-01-18 09:16:00 144
原创 LeetCode477. Total Hamming Distance
TheHamming distancebetween two integers is the number of positions at which the corresponding bits are different.Now your job is to find the total Hamming distance between all pairs of the given n...
2020-01-17 10:20:08 100
原创 LeetCode476. Number Complement
Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation.Note:The given integer is guaranteed to fit within the range of a 3...
2020-01-16 09:10:10 145
原创 LeetCode475. Heaters
Winter is coming! Your first job during the contest is to design a standard heater with fixed warm radius to warm all the houses.Now, you are given positions of houses and heaters on a horizontal li...
2020-01-15 10:37:59 132
原创 LeetCode474. Ones and Zeroes
In the computer world, use restricted resource you have to generate maximum benefit is what we always want to pursue.For now, suppose you are a dominator ofm0sandn1srespectively. On the other ...
2020-01-14 08:53:02 133
原创 LeetCode473. Matchsticks to Square
Remember the story of Little Match Girl? By now, you know exactly what matchsticks the little match girl has, please find out a way you can make one square by using up all those matchsticks. You shoul...
2020-01-11 10:48:22 107
原创 LeetCode472. Concatenated Words
Given a list of words (without duplicates), please write a program that returns all concatenated words in the given list of words.A concatenated word is defined as a string that is comprised entirel...
2020-01-09 14:55:51 130
原创 470. Implement Rand10() Using Rand7()
Given a functionrand7which generates a uniform random integer in the range 1 to 7, write a functionrand10which generates a uniform random integer in the range 1 to 10.Do NOT use system'sMath.ra...
2020-01-08 12:38:09 112
原创 LeetCode468. Validate IP Address
Write a function to check whether an input string is a valid IPv4 address or IPv6 address or neither.IPv4addresses are canonically represented in dot-decimal notation, which consists of four decima...
2020-01-07 09:22:51 120
原创 LeetCode467. Unique Substrings in Wraparound String
Consider the stringsto be the infinite wraparound string of "abcdefghijklmnopqrstuvwxyz", soswill look like this: "...zabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd....".Now we have a...
2020-01-06 11:33:31 97
原创 LeetCode466. Count The Repetitions
DefineS = [s,n]as the string S which consists of n connected strings s. For example,["abc", 3]="abcabcabc".On the other hand, we define that string s1 can be obtained from string s2 if we can re...
2020-01-03 17:58:33 129
原创 LeetCode464. Can I Win
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 or exceed 100 wins.What if we change the game so ...
2020-01-02 19:32:23 131
原创 LeetCode463. Island Perimeter
You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water.Grid cells are connected horizontally/vertically (not diagonally). The grid is completely...
2020-01-01 16:09:34 106
原创 LeetCode462. Minimum Moves to Equal Array Elements II
Given anon-emptyinteger array, find the minimum number of moves required to make all array elements equal, where a move is incrementing a selected element by 1 or decrementing a selected element by ...
2020-01-01 15:44:01 91
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人