题目链接:Add and Search Word - Data structure designDesign a data structure that supports the following two operations:void addWord(word) bool search(word) search(word) ca...
More »
题目链接:Course Schedule IIThere are a total of n courses you have to take, labeled from 0 to n - 1.Some courses may have prerequisites, for example to take course 0 you h...
More »
题目链接:Minimum Size Subarray SumGiven an array of n positive integers and a positive integer s, find the minimal length of a subarray of which the sum ≥ s. If there isn’...
More »
题目链接:Implement Trie (Prefix Tree)Implement a trie with insert, search, and startsWith methods.Note:You may assume that all inputs are consist of lowercase letters a-z....
More »
题目链接:Course ScheduleThere are a total of n courses you have to take, labeled from 0 to n - 1.Some courses may have prerequisites, for example to take course 0 you have...
More »
题目链接:Reverse Linked ListReverse a singly linked list.Hint:A linked list can be reversed either iteratively or recursively. Could you implement both?这道题的要求是反转链表。 迭...
More »
题目链接:Isomorphic StringsGiven two strings s and t, determine if they are isomorphic.Two strings are isomorphic if the characters in s can be replaced to get t.All occur...
More »
题目链接:Count PrimesDescription:Count the number of prime numbers less than a non-negative number, n.References:How Many Primes Are There?Sieve of Eratosthenes这道题的要求是统计小于...
More »
题目链接:Remove Linked List ElementsRemove all elements from a linked list of integers that have value val.Example:Given: 1 –> 2 –> 6 –> 3 –> 4 –> 5 –> 6...
More »
题目链接:Happy NumberWrite an algorithm to determine if a number is “happy”.A happy number is a number defined by the following process: Starting with any positive integer...
More »