加载中...
分类详情
中等 分类
275-H 指数 II(H-Index II)
原文链接: https://leetcode-cn.com/problems/h-index-ii 英文原文Given an array of integers citations where citations[i] is the number of citations a researcher received for their ith paper and citations is sorted in an ascending order, return compute the resea…
2021-12-03
284-窥探迭代器(Peeking Iterator)
原文链接: https://leetcode-cn.com/problems/peeking-iterator 英文原文Design an iterator that supports the peek operation on an existing iterator in addition to the hasNext and the next operations. Implement the PeekingIterator class: PeekingIterator(Iterator<…
2021-12-03
289-生命游戏(Game of Life)
原文链接: https://leetcode-cn.com/problems/game-of-life 英文原文According to Wikipedia's article: "The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Horton Conway in 1970." The board is made up of …
2021-12-03
299-猜数字游戏(Bulls and Cows)
原文链接: https://leetcode-cn.com/problems/bulls-and-cows 英文原文You are playing the Bulls and Cows game with your friend. You write down a secret number and ask your friend to guess what the number is. When your friend makes a guess, you provide a hint wit…
2021-12-03
306-累加数(Additive Number)
原文链接: https://leetcode-cn.com/problems/additive-number 英文原文Additive number is a string whose digits can form additive sequence. A valid additive sequence should contain at least three numbers. Except for the first two numbers, each subsequent number …
2021-12-03
319-灯泡开关(Bulb Switcher)
原文链接: https://leetcode-cn.com/problems/bulb-switcher 英文原文There are n bulbs that are initially off. You first turn on all the bulbs, then you turn off every second bulb. On the third round, you toggle every third bulb (turning on if it's off or turnin…
2021-12-03
328-奇偶链表(Odd Even Linked List)
原文链接: https://leetcode-cn.com/problems/odd-even-linked-list 英文原文Given the head of a singly linked list, group all the nodes with odd indices together followed by the nodes with even indices, and return the reordered list. The first node is considered…
2021-12-03
343-整数拆分(Integer Break)
原文链接: https://leetcode-cn.com/problems/integer-break 英文原文Given an integer n, break it into the sum of k positive integers, where k >= 2, and maximize the product of those integers. Return the maximum product you can get. Example 1: Input: n = 2 Outpu…
2021-12-03
371-两整数之和(Sum of Two Integers)
原文链接: https://leetcode-cn.com/problems/sum-of-two-integers 英文原文Given two integers a and b, return the sum of the two integers without using the operators + and -. Example 1: Input: a = 1, b = 2 Output: 3 Example 2: Input: a = 2, b = 3 Output: 5 Const…
2021-12-03
372-超级次方(Super Pow)
原文链接: https://leetcode-cn.com/problems/super-pow 英文原文Your task is to calculate ab mod 1337 where a is a positive integer and b is an extremely large positive integer given in the form of an array. Example 1: Input: a = 2, b = [3] Output: 8 Example 2:…
2021-12-03
376-摆动序列(Wiggle Subsequence)
原文链接: https://leetcode-cn.com/problems/wiggle-subsequence 英文原文A wiggle sequence is a sequence where the differences between successive numbers strictly alternate between positive and negative. The first difference (if one exists) may be either positi…
2021-12-03