水题
文章平均质量分 51
BoilerHouseKing
Stay hungry,stay foolish.
展开
-
[LeetCode]Isomorphic Strings
Given two strings s and t, determine if they are isomorphic. Two strings are isomorphic if the characters in s can be replaced to get t. All occurrences of a character must be replaced with anot原创 2015-04-29 22:23:39 · 656 阅读 · 0 评论 -
Longest Common Prefix
Write a function to find the longest common prefix string amongst an array of strings. class Solution { public: string longestCommonPrefix(vector& strs) { if(strs.size()==0) return "";原创 2015-05-11 20:59:46 · 514 阅读 · 0 评论 -
Roman to Integer
Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. class Solution { public: int romanToInt(string s) { unordered_map mp = {{"M",原创 2015-05-11 21:00:39 · 735 阅读 · 0 评论 -
ZigZag Conversion
The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility) P A H N A P L S I原创 2015-05-07 22:09:13 · 496 阅读 · 0 评论 -
Reverse Integer
Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 click to show spoilers. Have you thought about this? Here are some good questions to ask before c原创 2015-05-07 22:29:23 · 541 阅读 · 0 评论