Leetcode
小页睡着了zZ
算法能力的提升是一个循序渐进的过程
展开
-
Leetcode 1015.Numbers With Repeated Digits. Java代码
题目描述 Given a positive integer N, return the number of positive integers less than or equal to N that have at least 1 repeated digit. Example 1: Input: 20 Output: 1 Explanation: The only positive nu...原创 2019-03-20 15:25:30 · 200 阅读 · 0 评论 -
Leetcode 1012.Complement of Base 10 Integer
题目描述 Every non-negative integer N has a binary representation. For example, 5 can be represented as “101” in binary, 11 as “1011” in binary, and so on. Note that except for N = 0, there are no lead...原创 2019-03-22 10:09:21 · 157 阅读 · 0 评论 -
Leetcode 1013. Pairs of Songs With Total Durations Divisible by 60
题目描述(传送门) In a list of songs, the i-th song has a duration of time[i] seconds. Return the number of pairs of songs for which their total duration in seconds is divisible by 60. Formally, we want the...原创 2019-03-22 10:39:34 · 149 阅读 · 0 评论 -
Leetcode 1014. Capacity To Ship Packages Within D Days
题目描述(传送门) A conveyor belt has packages that must be shipped from one port to another within D days. The i-th package on the conveyor belt has a weight of weights[i]. Each day, we load the ship with ...原创 2019-03-22 15:07:36 · 245 阅读 · 0 评论 -
Leetcode 1022.Smallest Integer Divisible by K.
题目描述(传送门) Given a positive integer K, you need find the smallest positive integer N such that N is divisible by K, and N only contains the digit 1. Return the length of N. If there is no such N, ret...原创 2019-03-24 14:48:07 · 253 阅读 · 0 评论 -
Leetcode 1021. Best Sightseeing Pair.
题目描述 Given an array A of positive integers, A[i] represents the value of the i-th sightseeing spot, and two sightseeing spots i and j have distance j - i between them. The score of a pair (i < j) ...原创 2019-03-24 15:53:10 · 345 阅读 · 0 评论 -
LeetCode 1017.Convert to Base -2
1017.Convert to Base -2题目描述Examples:Note:Code1.2.递归方法3.更通用的方法 题目描述 传送门 Given a number N, return a string consisting of "0"s and "1"s that represents its value in base -2 (negative two). The returned ...原创 2019-04-01 19:38:41 · 388 阅读 · 0 评论 -
LeetCode 1019. Next Greater Node In Linked List
1019. Next Greater Node In Linked List题目描述Examples:Notes:Code1.2.用stack 题目描述 传送门 We are given a linked list with head as the first node. Let’s number the nodes in the list: node_1, node_2, node_3, …...原创 2019-04-01 20:36:48 · 611 阅读 · 0 评论