摘要: 描述Given a sorted linked list, delete all duplicates such that each element appear only once.For example,Given 1->1->2, return 1->2.Given 1->1->2->3->3 阅读全文
posted @ 2018-07-11 22:46 昵称真难想 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 题目: Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the 阅读全文
posted @ 2018-07-10 22:02 昵称真难想 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 描述Given n non-negative integers representing an elevation map where the width of each bar is 1, computehow much water it is able to trap after raining 阅读全文
posted @ 2018-07-08 23:24 昵称真难想 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 描述Given a string containing just the characters ’(’ and ’)’, find the length of the longest valid (wellformed) parentheses substring.For ”(()”, the l 阅读全文
posted @ 2018-07-05 20:05 昵称真难想 阅读(100) 评论(0) 推荐(0) 编辑
摘要: 描述Given a string containing just the characters ’(’, ’)’, ’{’, ’}’, ’[’ and ’]’, determine if theinput string is valid.The brackets must close in the 阅读全文
posted @ 2018-07-04 23:19 昵称真难想 阅读(90) 评论(0) 推荐(0) 编辑
摘要: 描述Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return thelength of last word in the string.If the last word 阅读全文
posted @ 2018-07-03 23:54 昵称真难想 阅读(85) 评论(0) 推荐(0) 编辑
摘要: 描述Given an absolute path for a file (Unix-style), simplify it.For example,path = "/home/", => "/home"path = "/a/./b/../../c/", => "/c"Corner Cases:• D 阅读全文
posted @ 2018-07-03 23:12 昵称真难想 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 描述Given an array of strings, return all groups of strings that are anagrams.Note: All inputs will be in lower-case.分析Anagram(回文构词法)是指打乱字母顺序从而得到新的单词,比如 阅读全文
posted @ 2018-07-03 21:58 昵称真难想 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 描述The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1 is read off as "one 1" or 11.11 is read of 阅读全文
posted @ 2018-07-03 10:51 昵称真难想 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 描述Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.分析从前往后扫描,用一个临时变量记录分段数字。如果当前比前一个大,说明这一段的值应该 阅读全文
posted @ 2018-06-18 22:14 昵称真难想 阅读(269) 评论(0) 推荐(0) 编辑