leetcode
Mr_Xu的博客
个人博客主页:www.xuchenbjtu.cn
展开
-
Leetcode_451 Sort Characters By Frequency
原题地址:https://leetcode.com/problems/sort-characters-by-frequency/?tab=Description Given a string, sort it in decreasing order based on the frequency of characters. Example 1: Input: "tree" Outp原创 2017-11-30 10:10:27 · 211 阅读 · 0 评论 -
Leetcode_735 Asteroid Collision
鉴于最近我可爱的她一直在写博客,突然想起我好久没有写过博客了。虽然我写的博客只想有心人能够看到,但是偶尔写写休息休息还是可以的,今天就拿一道leetcode的题目来写博客吧。 题目: We are given an array asteroids of integers representing asteroids in a row. For each asteroid, the原创 2017-12-02 01:04:16 · 304 阅读 · 0 评论 -
Leetcode_654 Maximum Binary Tree
一道难度为medium的题目,原题地址:https://leetcode.com/problems/maximum-binary-tree/description/,一道与树相关的题目,用递归的方法即可解决,执行时间为66ms。 题目: Given an integer array with no duplicates. A maximum tree building on this原创 2017-12-02 01:04:02 · 191 阅读 · 0 评论 -
leetcode_673 Number of Longest Increasing Subsequence
好久没有发过leetcode上面的题目的解决方法了,恰好今天做了一道难度为medium的题目,就发出来吧。 原题目链接:https://leetcode.com/problems/number-of-longest-increasing-subsequence/description/ 题目描述: Given an unsorted array of integers, find原创 2017-12-02 01:03:16 · 211 阅读 · 0 评论 -
Leetcode_189 Rotate Array
原题地址:https://leetcode.com/problems/rotate-array/#/description 题目: Rotate an array of n elements to the right by k steps. For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotate原创 2017-12-01 13:45:53 · 182 阅读 · 0 评论 -
Leetcode_65 Valid Number
忽然想起又有一周没写博客了,今天没做其它的,就做了一道题,就写写这道题吧。 题目: Validate if a given string is numeric. Some examples: "0" => true " 0.1 " => true "abc" => false "1 a" => false "2e10" => true Note: It is in原创 2017-12-08 19:37:17 · 181 阅读 · 0 评论 -
Leetcode_5 Longest Palindromic Substring
一道难度为medium的题目,原题地址:https://leetcode.com/problems/longest-palindromic-substring/,用动态规划即可解决,但是效率不是特别高,执行时间为93ms。 题目: Given a string s, find the longest palindromic substring in s. You may assume原创 2017-11-30 10:30:19 · 167 阅读 · 0 评论 -
Leetcode_84 Largest Rectangle in Histogram
今天看了看Leetcode_84题,难度是hard,趁着空闲,简单地写一写吧。 原题链接:https://leetcode.com/problems/largest-rectangle-in-histogram/?tab=Description 原题题目: Given n non-negative integers representing the histogram's bar原创 2017-11-30 10:17:18 · 178 阅读 · 0 评论 -
Leetcode_520 Detect Capital
本人比较喜欢520这个数字,但加上这道题比较简单(属于easy等级),本人又是学渣一枚,又感觉好久没有写过博文了,随便写一篇滥竽充数吧[破涕为笑]。 原题链接:https://leetcode.com/problems/detect-capital/?tab=Description 原题题目: Given a word, you need to judge w...原创 2017-11-30 10:14:36 · 208 阅读 · 0 评论 -
Leetcode_406 Queue Reconstruction by Height
闲来无事,又做了一道题,写一篇博客吧。 题目: Suppose you have a random list of people standing in a queue. Each person is described by a pair of integers (h, k), where h is the height of the person and k is the nu原创 2017-12-14 13:47:25 · 221 阅读 · 0 评论