摘要:https://oj.leetcode.com/problems/search-insert-position/ Given a sorted array and a target value, return the index if the target is found. If not, ret
阅读全文
随笔分类 - LeetCode
摘要:https://oj.leetcode.com/problems/populating-next-right-pointers-in-each-node/Given a binary tree struct TreeLinkNode { TreeLinkNode *left; ...
阅读全文
摘要:https://oj.leetcode.com/problems/binary-tree-inorder-traversal/Given a binary tree, return theinordertraversal of its nodes' values.For example:Given ...
阅读全文
摘要:https://oj.leetcode.com/problems/binary-tree-preorder-traversal/Given a binary tree, return thepreordertraversal of its nodes' values.For example:Give...
阅读全文
摘要:https://oj.leetcode.com/problems/gas-station/ There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. You hav
阅读全文
摘要:https://oj.leetcode.com/problems/maximum-subarray/Find the contiguous subarray within an array (containing at least one number) which has the largest ...
阅读全文
摘要:https://oj.leetcode.com/problems/unique-binary-search-trees/Givenn, how many structurally uniqueBST's(binary search trees) that store values 1...n?For...
阅读全文
摘要:https://oj.leetcode.com/problems/single-number/Given an array of integers, every element appearstwiceexcept for one. Find that single one.Note:Your al...
阅读全文
摘要:https://oj.leetcode.com/problems/maximum-depth-of-binary-tree/ Given a binary tree, find its maximum depth. The maximum depth is the number of nodes a
阅读全文
摘要:https://oj.leetcode.com/problems/same-tree/ Given two binary trees, write a function to check if they are equal or not. Two binary trees are considere
阅读全文
摘要:https://oj.leetcode.com/problems/excel-sheet-column-number/Related to questionExcel Sheet Column TitleGiven a column title as appear in an Excel sheet...
阅读全文
摘要:https://oj.leetcode.com/problems/linked-list-cycle/ Given a linked list, determine if it has a cycle in it. Follow up:Can you solve it without using e
阅读全文
摘要:https://oj.leetcode.com/problems/remove-duplicates-from-sorted-list/ Given a sorted linked list, delete all duplicates such that each element appear o
阅读全文
摘要:https://oj.leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/Say you have an array for which theithelement is the price of a given stock on day...
阅读全文
摘要:https://oj.leetcode.com/problems/best-time-to-buy-and-sell-stock/ Say you have an array for which the ith element is the price of a given stock on day
阅读全文
摘要:https://oj.leetcode.com/problems/two-sum/Given an array of integers, find two numbers such that they add up to a specific target number.The function t...
阅读全文
摘要:https://oj.leetcode.com/problems/reverse-words-in-a-string/ Given an input string, reverse the string word by word. For example,Given s = "the sky is
阅读全文
摘要:https://oj.leetcode.com/problems/reverse-integer/ Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321 解题思路: 对输入
阅读全文

浙公网安备 33010602011771号