
刷题
uglyzu
未入门。
展开
-
234. Palindrome Linked List
Given a singly linked list, determine if it is a palindrome.Example 1:Input: 1->2 Output: falseExample 2:Input: 1->2->2->1 Output: trueFollow up: Could you do it in O(n) time ...转载 2018-07-09 20:05:55 · 126 阅读 · 0 评论 -
160. Intersection of Two Linked Lists
Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists:A: a1 → a2 ↘ ...转载 2018-07-10 12:31:15 · 110 阅读 · 0 评论 -
581. Shortest Unsorted Continuous Subarray
Given an integer array, you need to find one continuous subarray that if you only sort this subarray in ascending order, then the whole array will be sorted in ascending order, too.You need to find ...转载 2018-07-10 15:17:01 · 129 阅读 · 0 评论 -
532. K-diff Pairs in an Array
Given an array of integers and an integer k, you need to find the number of unique k-diff pairs in the array. Here a k-diff pair is defined as an integer pair (i, j), where i and j are both numbers in...转载 2018-07-10 17:46:13 · 143 阅读 · 0 评论 -
442. Find All Duplicates in an Array
Given an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once.Find all the elements that appear twice in this array.Could you do it without extra ...转载 2018-07-11 10:43:13 · 141 阅读 · 0 评论 -
238. Product of Array Except Self
Given an array nums of n integers where n > 1, return an array output such that output[i] is equal to the product of all the elements of nums except nums[i].Example:Input: [1,2,3,4] Output: ...转载 2018-07-11 15:15:14 · 156 阅读 · 0 评论 -
565. Array Nesting
A zero-indexed array A of length N contains all integers from 0 to N-1. Find and return the longest length of set S, where S[i] = {A[i], A[A[i]], A[A[A[i]]], … } subjected to the rule below.Suppose ...转载 2018-07-11 17:44:34 · 189 阅读 · 0 评论