随笔分类 - leetcode
摘要:https://leetcode.com/problems/count-of-smaller-numbers-after-self/You are given an integer array nums and you have to return a new counts array. The c...
阅读全文
摘要:https://leetcode.com/problems/sum-root-to-leaf-numbers/Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a n...
阅读全文
摘要:Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representatio...
阅读全文
摘要:https://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 have ...
阅读全文
摘要:https://leetcode.com/problems/coin-change/You are given coins of different denominations and a total amount of money amount. Write a function to compu...
阅读全文
摘要:https://leetcode.com/problems/binary-tree-maximum-path-sum/Given a binary tree, find the maximum path sum.For this problem, a path is defined as any s...
阅读全文
摘要:https://leetcode.com/problems/search-for-a-range/Given a sorted array of integers, find the starting and ending position of a given target value.Your ...
阅读全文
摘要:https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in...
阅读全文
摘要:https://leetcode.com/problems/edit-distance/Given two wordsword1andword2, find the minimum number of steps required to convertword1toword2. (each oper...
阅读全文
摘要:https://leetcode.com/problems/game-of-life/According to theWikipedia's article: "TheGame of Life, also known simply asLife, is a cellular automaton de...
阅读全文
摘要:https://leetcode.com/problems/decode-ways/A message containing letters fromA-Zis being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...
阅读全文
摘要:https://leetcode.com/problems/text-justification/Given an array of words and a lengthL, format the text such that each line has exactlyLcharacters and...
阅读全文
摘要:https://leetcode.com/problems/isomorphic-strings/Given two stringssandt, determine if they are isomorphic.Two strings are isomorphic if the characters...
阅读全文
摘要:https://leetcode.com/problems/h-index/Given an array of citations (each citation is a non-negative integer) of a researcher, write a function to compu...
阅读全文
摘要:https://leetcode.com/problems/dungeon-game/The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. The du...
阅读全文
摘要:https://leetcode.com/problems/interleaving-string/Givens1,s2,s3, find whethers3is formed by the interleaving ofs1ands2.For example,Given:s1="aabcc",s2...
阅读全文
摘要:https://leetcode.com/problems/palindrome-partitioning/Given a strings, partitionssuch that every substring of the partition is a palindrome.Return all...
阅读全文
摘要:https://leetcode.com/problems/ugly-number/Write a program to check whether a given number is an ugly number.Ugly numbers are positive numbers whose pr...
阅读全文
摘要:https://leetcode.com/problems/word-break/Given a stringsand a dictionary of wordsdict, determine ifscan be segmented into a space-separated sequence o...
阅读全文
摘要:Given an integer arraynums, find the sum of the elements between indicesiandj(i≤j), inclusive.Theupdate(i, val)function modifiesnumsby updating the el...
阅读全文

浙公网安备 33010602011771号