摘要:https://leetcode.com/problems/isomorphic-strings/Given two stringssandt, determine if they are isomorphic.Two strings are isomorphic if the characters...
阅读全文
随笔分类 - LeetCode
摘要:https://leetcode.com/problems/add-and-search-word-data-structure-design/ Design a data structure that supports the following two operations: search(wo
阅读全文
摘要:https://leetcode.com/problems/implement-trie-prefix-tree/Implement a trie withinsert,search, andstartsWithmethods.Note:You may assume that all inputs ...
阅读全文
摘要:https://leetcode.com/problems/house-robber-ii/ Note: This is an extension of House Robber. After robbing those houses on that street, the thief has fo
阅读全文
摘要:https://leetcode.com/problems/summary-ranges/Given a sorted integer array without duplicates, return the summary of its ranges.For example, given[0,1,...
阅读全文
摘要:https://leetcode.com/problems/rectangle-area/Find the total area covered by tworectilinearrectangles in a2Dplane.Each rectangle is defined by its bott...
阅读全文
摘要:https://leetcode.com/problems/course-schedule-ii/There are a total ofncourses you have to take, labeled from0ton - 1.Some courses may have prerequisit...
阅读全文
摘要:https://leetcode.com/problems/course-schedule/ There are a total of n courses you have to take, labeled from 0 to n - 1. Some courses may have prerequ
阅读全文
摘要:https://leetcode.com/problems/minimum-size-subarray-sum/Given an array ofnpositive integers and a positive integers, find the minimal length of a suba...
阅读全文
摘要:https://leetcode.com/problems/count-primes/Description:Count the number of prime numbers less than a non-negative number,n.解题思路:如何判定一个数为质数?1. 质数最小的是2。...
阅读全文
摘要:https://leetcode.com/problems/count-complete-tree-nodes/Given acompletebinary tree, count the number of nodes.Definition of a complete binary tree fro...
阅读全文
摘要:https://leetcode.com/problems/implement-stack-using-queues/Implement the following operations of a stack using queues.push(x) -- Push element x onto s...
阅读全文
摘要:https://leetcode.com/problems/invert-binary-tree/Invert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9...
阅读全文
摘要:https://leetcode.com/problems/contains-duplicate-ii/Given an array of integers and an integerk, find out whether there there are two distinct indicesi...
阅读全文
摘要:https://leetcode.com/problems/kth-largest-element-in-an-array/description/ Find the kth largest element in an unsorted array. Note that it is the kth
阅读全文
摘要:https://leetcode.com/problems/contains-duplicate/Given an array of integers, find if the array contains any duplicates. Your function should return tr...
阅读全文
摘要:https://leetcode.com/problems/combination-sum-iii/ Find all possible combinations of k numbers that add up to a number n, given that only numbers from
阅读全文
摘要:https://leetcode.com/problems/merge-sorted-array/Given two sorted integer arraysnums1andnums2, mergenums2intonums1as one sorted array.Note:You may ass...
阅读全文
摘要:https://leetcode.com/problems/reverse-linked-list/Reverse a singly linked list.解题思路:类似于插入排序,始终将当前节点插入到最前方。/** * Definition for singly-linked list. * p...
阅读全文
摘要:https://leetcode.com/problems/binary-tree-postorder-traversal/Given a binary tree, return thepostordertraversal of its nodes' values.For example:Given...
阅读全文

浙公网安备 33010602011771号