摘要: class Solution { public: string countAndSay(int n) { string str,ans; str="1"; if(n--==1) return str; while(n--){ ans.clear(); int left=0,ri... 阅读全文
posted @ 2018-05-09 23:12 Little_Shel 阅读(124) 评论(0) 推荐(0) 编辑
摘要: class Solution { public: int romanToInt(string s) { int ans=0; unordered_map mp; mp['I']=1; mp['V']=5; mp['X']=10; mp['L']=50; mp['C']=100;... 阅读全文
posted @ 2018-05-09 22:37 Little_Shel 阅读(90) 评论(0) 推荐(0) 编辑
摘要: 还没有解决的问题:你能不将整数转为字符串来解决这个问题吗?(思考ing) 阅读全文
posted @ 2018-05-09 21:41 Little_Shel 阅读(98) 评论(0) 推荐(0) 编辑
摘要: class Solution { public: vector twoSum(vector& nums, int target) { vector v(2,0); unordered_map hashtable; for(int i=nums.size();i--;hashtable[nums[i]]=i){ if(... 阅读全文
posted @ 2018-05-09 21:19 Little_Shel 阅读(69) 评论(0) 推荐(0) 编辑