![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode
Valerie7012
渣渣
展开
-
Find the Difference(leetcode)
Find the DifferenceGiven two strings s and t which consist of only lowercase letters.String t is generated by random shuffling string s and then add one more letter at a random position.原创 2017-12-07 10:34:04 · 209 阅读 · 0 评论 -
Find Smallest Letter Greater Than Target(leetcode)
Find Smallest Letter Greater Than TargetGiven a list of sorted characters letters and given a target letter target, find the smallest element in the list that is larger than the given target.原创 2017-12-19 16:14:09 · 258 阅读 · 0 评论 -
Course Schedule(leetcode)
Course ScheduleThere are a total of n courses you have to take, labeled from 0 to n - 1.Given the total number of courses and a list of prerequisite pairs, is it possible for you to finish all courses?原创 2017-12-19 16:17:16 · 217 阅读 · 0 评论 -
771.Jewels and Stones (leetcode)
Strings J representing the types of stones that are jewels, and S representing the stones you have. Each character in S is a type of stone you have. You want to know how many of the stones are also jewels.原创 2018-01-28 20:45:08 · 2322 阅读 · 0 评论 -
760. Find Anagram Mappings (leetcode)
Find Anagram MappingsGiven two lists A and B, and B is an anagram of A. We want We want to We want to find an index mapping P, from A to B. A mapping P[i] = j means the ith element in A appears in B at index j原创 2018-01-28 21:10:35 · 330 阅读 · 0 评论 -
766. Toeplitz Matrix (leetcode)
A matrix is Toeplitz if every diagonal from top-left to bottom-right has the same element. Now given an M x N matrix, return True if and only if the matrix is Toeplitz.原创 2018-01-28 21:30:38 · 367 阅读 · 0 评论 -
804. Unique Morse Code Words
804. Unique Morse Code Words804. Unique Morse Code Words题目解决题目Leetcode题目International Morse Code defines a standard encoding where each letter is mapped to a series of dots and das...原创 2018-04-07 20:21:52 · 161 阅读 · 0 评论 -
762. Prime Number of Set Bits in Binary Representation
762. Prime Number of Set Bits in Binary Representation762. Prime Number of Set Bits in Binary Representation题目解决题目Leetcode题目Given two integers L and R, find the count of numbers in...原创 2018-04-21 15:34:08 · 198 阅读 · 0 评论 -
784. Letter Case Permutation
784. Letter Case Permutation784. Letter Case Permutation题目解决题目Leetcode题目Given a string S, we can transform every letter individually to be lowercase or uppercase to create another ...原创 2018-04-21 15:45:36 · 191 阅读 · 0 评论 -
Best Time to Buy and Sell Stock II(leetcode)
Best Time to Buy and Sell Stock IIDesign an algorithm to find the maximum profit. You may complete as many transactions as you like (ie, buy one and sell one share of the stock multiple times).原创 2017-12-19 15:48:28 · 203 阅读 · 0 评论 -
Minimum Moves to Equal Array Elements(leetcode)
Minimum Moves to Equal Array ElementsGiven a non-empty integer array of size n, find the minimum number of moves required to make all array elements equal, where a move is incrementing n - 1 elements by 1.原创 2017-12-19 15:42:04 · 184 阅读 · 0 评论 -
Excel Sheet Column Number(leetcode)
Excel Sheet Column NumberGiven a column title as appear in an Excel sheet, return its corresponding column number.原创 2017-12-19 15:26:49 · 218 阅读 · 0 评论 -
Move Zeroes(leetcode)
Move ZeroesGiven an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements.原创 2017-12-07 10:46:20 · 145 阅读 · 0 评论 -
Two Sum IV - Input is a BST(leetcode)
Two Sum IV - Input is a BSTGiven a Binary Search Tree and a target number, return true if there exist two elements in the BST such that their sum is equal to the given target.原创 2017-12-07 11:04:32 · 234 阅读 · 0 评论 -
Construct String from Binary Tree(leetcode)
Construct String from Binary TreeYou need to construct a string consists of parenthesis and integers from a binary tree with the preorder traversing way.原创 2017-12-07 11:07:27 · 196 阅读 · 0 评论 -
Flood Fill(leetcode)
Flood FillAn image is represented by a 2-D array of integers.Given a coordinate (sr, sc) representing the starting pixel (row and column) of the flood fill, and a pixel value newColor, "flood fill" the image.原创 2017-12-19 14:54:59 · 710 阅读 · 0 评论 -
Convert BST to Greater Tree(leetcode)
Convert BST to Greater TreeGiven a BST, convert it to a Greater Tree such that every key of the original BST is changed to the original key plus sum of all keys greater than the original key in BST.原创 2017-12-19 15:06:21 · 195 阅读 · 0 评论 -
Construct the Rectangle(leetcode)
Construct the RectangleFor a web developer, it is very important to know how to design a web page's size. So, given a specific rectangular web page’s area, your job by now is to design a rectangular web page.原创 2017-12-19 15:14:49 · 202 阅读 · 0 评论 -
Range Addition II(leetcode)
Range Addition IIGiven an m * n matrix M initialized with all 0's and several update operations. You need to count and return the number of maximum integers in the matrix after performing all the operations.原创 2017-12-19 15:21:50 · 224 阅读 · 0 评论 -
806. Number of Lines To Write String
806. Number of Lines To Write String806. Number of Lines To Write String题目解决题目Leetcode题目We are to write the letters of a given string S, from left to right into lines. Each line ha...原创 2018-04-21 15:58:47 · 236 阅读 · 0 评论 -
811. Subdomain Visit Count
811. Subdomain Visit Count811. Subdomain Visit Count题目解决题目Leetcode题目A website domain like “discuss.leetcode.com” consists of various subdomains. At the top level, we have “com”, at...原创 2018-04-21 16:19:53 · 222 阅读 · 0 评论 -
892. Surface Area of 3D Shapes
On a N * N grid, we place some 1 * 1 * 1 cubes. Each value v = grid[i][j] represents a tower of v cubes placed on top of grid cell (i, j). Return the total surface area of the resulting shapes.原创 2018-09-02 15:55:59 · 285 阅读 · 0 评论 -
830. Positions of Large Groups
In a string S of lowercase letters, these letters form consecutive groups of the same character. Call a group large if it has 3 or more characters. We would like the starting and ending positions of every large group.原创 2018-09-02 16:05:13 · 213 阅读 · 0 评论 -
783. Minimum Distance Between BST Nodes
Given a Binary Search Tree (BST) with the root node root, return the minimum difference between the values of any two different nodes in the tree.原创 2018-09-02 16:10:32 · 162 阅读 · 0 评论 -
819. Most Common Word
Given a paragraph and a list of banned words, return the most frequent word that is not in the list of banned words. It is guaranteed there is at least one word that isn't banned, and that the answer is unique.原创 2018-09-02 16:18:46 · 254 阅读 · 0 评论 -
888. Fair Candy Swap
Return an integer array ans where ans[0] is the size of the candy bar that Alice must exchange, and ans[1] is the size of the candy bar that Bob must exchange.原创 2018-09-02 16:29:38 · 236 阅读 · 0 评论 -
844. Backspace String Compare
Given two strings S and T, return if they are equal when both are typed into empty text editors. # means a backspace character.原创 2018-09-03 20:36:41 · 199 阅读 · 0 评论 -
860. Lemonade Change
At a lemonade stand, each lemonade costs $5. Customers are standing in a queue to buy from you, and order one at a time (in the order specified by bills).Each customer will only buy one lemonade and pay with either a $5, $10, or $20 bill. You must pro原创 2018-09-03 20:44:49 · 187 阅读 · 0 评论 -
788. Rotated Digits
788. Rotated Digits788. Rotated Digits题目解决题目Leetcode题目X is a good number if after rotating each digit individually by 180 degrees, we get a valid number that is different from X....原创 2018-09-03 20:49:26 · 199 阅读 · 0 评论 -
893. Groups of Special-Equivalent Strings
You are given an array A of strings. Two strings S and T are special-equivalent if after any number of moves, S == T. A move consists of choosing two indices i and j with i % 2 == j % 2. Return the number of groups of special-equivalent strings.原创 2018-09-02 14:51:18 · 228 阅读 · 0 评论 -
896. Monotonic Array
An array is monotonic if it is either monotone increasing or monotone decreasing. Return true if and only if the given array A is monotonic.原创 2018-09-02 14:25:19 · 364 阅读 · 0 评论 -
590. N-ary Tree Postorder Traversal
Given an n-ary tree, return the postorder traversal of its nodes' values.原创 2018-08-15 22:12:42 · 246 阅读 · 0 评论 -
812. Largest Triangle Area
812. Largest Triangle Area812. Largest Triangle Area题目解决题目Leetcode题目You have a list of points in the plane. Return the area of the largest triangle that can be formed by any 3 of...原创 2018-04-21 17:22:53 · 310 阅读 · 0 评论 -
709. To Lower Case
Implement function ToLowerCase() that has a string parameter str, and returns the same string in lowercase.原创 2018-08-07 17:31:26 · 141 阅读 · 0 评论 -
887. Projection Area of 3D Shapes
On a N * N grid, we place some 1 * 1 * 1 cubes that are axis-aligned with the x, y, and z axes. Each value v = grid[i][j] represents a tower of v cubes placed on top of grid cell (i, j). Return the total area of all three projections.原创 2018-08-07 17:42:24 · 362 阅读 · 0 评论 -
884. Uncommon Words from Two Sentences
We are given two sentences A and B. (A sentence is a string of space separated words. Each word consists only of lowercase letters.) Return a list of all uncommon words.原创 2018-08-13 15:09:55 · 309 阅读 · 0 评论 -
872. Leaf-Similar Trees
Consider all the leaves of a binary tree. From left to right order, the values of those leaves form a leaf value sequence. Return true if and only if the two given trees with head nodes root1 and root2 are leaf-similar.原创 2018-08-15 20:24:17 · 171 阅读 · 0 评论 -
821. Shortest Distance to a Character
Given a string S and a character C, return an array of integers representing the shortest distance from the character C in the string.原创 2018-08-15 20:58:41 · 221 阅读 · 0 评论 -
868. Binary Gap
Given a positive integer N, find and return the longest distance between two consecutive 1's in the binary representation of N. If there aren't two consecutive 1's, return 0.原创 2018-08-15 21:23:35 · 235 阅读 · 0 评论 -
559. Maximum Depth of N-ary Tree
Given a n-ary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.原创 2018-08-15 21:48:36 · 204 阅读 · 0 评论