随笔分类 -  LeetCode

上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 20 下一页
摘要:Add and Search Word - Data structure design (M) 题目 Design a data structure that supports the following two operations: void addWord(word) bool search( 阅读全文
posted @ 2020-08-06 14:23 墨云黑 阅读(171) 评论(0) 推荐(0)
摘要:Implement Trie (Prefix Tree) (M) 题目 Implement a trie with insert, search, and startsWith methods. Example: Trie trie = new Trie(); trie.insert("apple" 阅读全文
posted @ 2020-08-06 13:58 墨云黑 阅读(146) 评论(0) 推荐(0)
摘要:Power of Four (E) 题目 Given an integer (signed 32 bits), write a function to check whether it is a power of 4. Example 1: Input: 16 Output: true Exampl 阅读全文
posted @ 2020-08-05 11:29 墨云黑 阅读(99) 评论(0) 推荐(0)
摘要:Valid Palindrome (E) 题目 Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. Note: For the pu 阅读全文
posted @ 2020-08-03 21:32 墨云黑 阅读(118) 评论(0) 推荐(0)
摘要:Design HashSet (E) 题目 Design a HashSet without using any built-in hash table libraries. To be specific, your design should include these functions: ad 阅读全文
posted @ 2020-08-03 07:47 墨云黑 阅读(173) 评论(0) 推荐(0)
摘要:Detect Capital (E) 题目 Given a word, you need to judge whether the usage of capitals in it is right or not. We define the usage of capitals in a word t 阅读全文
posted @ 2020-08-02 09:29 墨云黑 阅读(161) 评论(0) 推荐(0)
摘要:Climbing Stairs (E) 题目 You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many d 阅读全文
posted @ 2020-08-01 09:57 墨云黑 阅读(191) 评论(0) 推荐(0)
摘要:Word Break II (H) 题目 Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, add spaces in s to construct a sentenc 阅读全文
posted @ 2020-07-31 10:41 墨云黑 阅读(197) 评论(0) 推荐(0)
摘要:Best Time to Buy and Sell Stock with Cooldown (M) 题目 Say you have an array for which the ith element is the price of a given stock on day i. Design an 阅读全文
posted @ 2020-07-30 10:27 墨云黑 阅读(173) 评论(0) 推荐(0)
摘要:Task Scheduler (M) 题目 You are given a char array representing tasks CPU need to do. It contains capital letters A to Z where each letter represents a 阅读全文
posted @ 2020-07-29 08:35 墨云黑 阅读(137) 评论(0) 推荐(0)
摘要:Construct Binary Tree from Inorder and Postorder Traversal (M) 题目 Given inorder and postorder traversal of a tree, construct the binary tree. Note: Yo 阅读全文
posted @ 2020-07-28 09:16 墨云黑 阅读(176) 评论(0) 推荐(0)
摘要:Add Digits (E) 题目 Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. Example: Input: 38 Output: 2 Ex 阅读全文
posted @ 2020-07-27 09:49 墨云黑 阅读(171) 评论(0) 推荐(0)
摘要:Find Minimum in Rotated Sorted Array II (H) 题目 Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., [ 阅读全文
posted @ 2020-07-26 09:17 墨云黑 阅读(108) 评论(0) 推荐(0)
摘要:All Paths From Source to Target (M) 题目 Given a directed, acyclic graph of N nodes. Find all possible paths from node 0 to node N-1, and return them in 阅读全文
posted @ 2020-07-25 08:13 墨云黑 阅读(130) 评论(0) 推荐(0)
摘要:Single Number III (M) 题目 Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twic 阅读全文
posted @ 2020-07-24 08:02 墨云黑 阅读(175) 评论(0) 推荐(0)
摘要:Edit Distance (H) 题目 Given two words word1 and word2, find the minimum number of operations required to convert word1 to word2. You have the following 阅读全文
posted @ 2020-07-23 06:58 墨云黑 阅读(168) 评论(0) 推荐(0)
摘要:Binary Tree Zigzag Level Order Traversal (M) 题目 Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to r 阅读全文
posted @ 2020-07-23 06:28 墨云黑 阅读(153) 评论(0) 推荐(0)
摘要:Burst Balloons (H) 题目 Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked to 阅读全文
posted @ 2020-07-22 16:57 墨云黑 阅读(171) 评论(0) 推荐(0)
摘要:Word Search (M) 题目 Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of sequentially adjacent 阅读全文
posted @ 2020-07-22 10:32 墨云黑 阅读(229) 评论(0) 推荐(0)
摘要:Add Binary (E) 题目 Given two binary strings, return their sum (also a binary string). The input strings are both non-empty and contains only characters 阅读全文
posted @ 2020-07-21 08:29 墨云黑 阅读(164) 评论(0) 推荐(0)

上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 20 下一页