Reorder List
Given a singly linked list L: L0→L1→…→Ln-1→Ln, reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You may not modify the values in the list’s nodes, only nodes itself may be changed.
(链表重新排序)
Given a singly linked list L: L0→L1→…→Ln-1→Ln, reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You may not modify the values in the list’s nodes, only nodes itself may be changed.
(链表重新排序)
Given a linked list, return the node where the cycle begins. If there is no cycle, return null. To represent a cycle in the given linked list, we use an integer pos which represents the position (0-indexed) in the linked list where tail connects to. If pos is -1, then there is no cycle in the linked list.
(链表中环的起点)
Given a linked list, determine if it has a cycle in it. To represent a cycle in the given linked list, we use an integer pos which represents the position (0-indexed) in the linked list where tail connects to. If pos is -1, then there is no cycle in the linked list.
(链表有环)
Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, add spaces in s to construct a sentence where each word is a valid dictionary word. Return all such possible sentences.
(字符串有效分词)
Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, determine if s can be segmented into a space-separated sequence of one or more dictionary words.
(字符串是否可以有效分词)
A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null. Return a deep copy of the list.
(深拷贝链表)
Given a non-empty array of integers, every element appears three times except for one, which appears exactly once. Find that single one.
(只出现一次的数字(其余出现三次))
Given a non-empty array of integers, every element appears twice except for one. Find that single one.
(只出现一次的数字(其余出现两次))
There are N children standing in a line. Each child is assigned a rating value. You are giving candies to these children subjected to the following requirements:
What is the minimum candies you must give?
(分糖问题)
There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from station i to its next station (i+1). You begin the journey with an empty tank at one of the gas stations. Return the starting gas station’s index if you can travel around the circuit once in the clockwise direction, otherwise return -1.
(加油站问题)