随笔分类 - LeetCode
摘要:House Robber III The thief has found himself a new place for his thievery again. There is only one entrance to this area, called the "root." Besides t
阅读全文
摘要:Jump Game Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents
阅读全文
摘要:Find the Duplicate Number Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one dup
阅读全文
摘要:H-Index Given an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the researcher's h-index. A
阅读全文
摘要:First Bad Version You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product f
阅读全文
摘要:Ugly Number II Write a program to find the n-th ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example,
阅读全文
摘要:Rotate Array Rotate an array of n elements to the right by k steps. For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,
阅读全文
摘要:Reverse Linked List Reverse a singly linked list. Hint: A linked list can be reversed either iteratively or recursively. Could you implement both?
阅读全文
摘要:Linked List Cycle II Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Note: Do not modify the linked li
阅读全文
摘要:Merge Sorted Array Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note: You may assume that nums1 has en
阅读全文
摘要:Linked List Cycle Given a linked list, determine if it has a cycle in it. Follow up: Can you solve it without using extra space?
阅读全文
摘要:Remove Duplicates from Sorted Array II Follow up for "Remove Duplicates": What if duplicates are allowed at most twice? For example, Given sorted arra
阅读全文
摘要:Rotate List Given a list, rotate the list to the right by k places, where k is non-negative. For example: Given 1->2->3->4->5->NULL and k = 2, return
阅读全文
摘要:Sort Colors Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the
阅读全文
摘要:Jump Game II Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represen
阅读全文
摘要:Remove Nth Node From End of List Given a linked list, remove the nth node from the end of list and return its head. For example, Given linked list: 1-
阅读全文
摘要:Remove Duplicates from Sorted Array Given a sorted array, remove the duplicates in place such that each element appear only once and return the new le
阅读全文
摘要:Longest Substring Without Repeating Characters Given a string, find the length of the longest substring without repeating characters. Examples: Given
阅读全文
摘要:House Robber II Note: This is an extension of House Robber. After robbing those houses on that street, the thief has found himself a new place for his
阅读全文
摘要:House Robber You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constrain
阅读全文

浙公网安备 33010602011771号