摘要: Given two strings s and t , write a function to determine if t is an anagram of s. Example 1: Input: s = "anagram", t = "nagaram" Output: true Example 阅读全文
posted @ 2019-11-12 08:47 xuan_abc 阅读(115) 评论(0) 推荐(0)
摘要: Given a positive integer, return its corresponding column title as appear in an Excel sheet. For example: 1 -> A 2 -> B 3 -> C ... 26 -> Z 27 -> AA 28 阅读全文
posted @ 2019-11-11 09:27 xuan_abc 阅读(118) 评论(0) 推荐(0)
摘要: Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string "". Exampl 阅读全文
posted @ 2019-11-11 05:56 xuan_abc 阅读(108) 评论(0) 推荐(0)
摘要: Compare two version numbers version1 and version2.If version1 > version2 return 1; if version1 < version2 return -1;otherwise return 0. You may assume 阅读全文
posted @ 2019-11-11 05:43 xuan_abc 阅读(138) 评论(0) 推荐(0)
摘要: Implement strStr(). Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Example 1: Input: haystac 阅读全文
posted @ 2019-11-10 11:10 xuan_abc 阅读(112) 评论(0) 推荐(0)
摘要: Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining. 阅读全文
posted @ 2019-11-10 10:17 xuan_abc 阅读(140) 评论(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 hist 阅读全文
posted @ 2019-11-10 05:07 xuan_abc 阅读(324) 评论(0) 推荐(0)
摘要: Implement a basic calculator to evaluate a simple expression string. The expression string may contain open ( and closing parentheses ), the plus + or 阅读全文
posted @ 2019-11-10 00:42 xuan_abc 阅读(123) 评论(0) 推荐(0)
摘要: Given an encoded string, return its decoded string. The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is be 阅读全文
posted @ 2019-11-05 12:02 xuan_abc 阅读(170) 评论(0) 推荐(0)
摘要: Given an absolute path for a file (Unix-style), simplify it. Or in other words, convert it to the canonical path. In a UNIX-style file system, a perio 阅读全文
posted @ 2019-11-03 11:40 xuan_abc 阅读(96) 评论(0) 推荐(0)