lintcode-比较字符串-55
来源:互联网 发布:ubuntu debian fedora 编辑:程序博客网 时间:2024/06/10 06:15
比较两个字符串A和B,确定A中是否包含B中所有的字符。字符串A和B中的字符都是 大写字母
您在真实的面试中是否遇到过这个题?样例
给出 A = "ABCD"
B = "ACD"
,返回 true
给出 A = "ABCD"
B = "AABC"
, 返回 false
注意 在 A 中出现的 B 字符串里的字符不需要连续或者有序
class Solution {public: bool compareStrings(string A, string B) { // write your code here map<char,int> check; for(auto e:A) ++check[e]; for(auto e:B){ if(--check[e]<0) return false; } return true; } };
0 0
- lintcode-比较字符串-55
- lintCode 55:比较字符串
- LintCode-第55题 比较字符串
- Lintcode(2)-比较字符串
- LintCode比较字符串
- Lintcode 比较字符串
- LintCode 比较字符串
- Lintcode 比较字符串
- LintCode-比较字符串
- lintcode刷题--比较字符串
- LintCode 比较字符串
- Lintcode-比较字符串
- lintcode ----比较字符串
- LintCode之比较字符串
- LintCode : 比较字符串
- Lintcode 比较字符串
- LintCode 54 比较字符串
- LintCode-比较字符串
- 紫影龙的编程日记 —— 界面设计之静态文本控件
- monkeyrunner截图限时免费阅读#2:多线程保存
- 线程管理之Thread类相关方法简介
- [Java Concurrency in Practice]第十三章 显式锁
- react-native试玩(18)-开关控件
- lintcode-比较字符串-55
- HDU-4289 Control
- MYSQL的常用命令和增删改查语句和数据类型
- react-native试玩(19)-分页栏
- 一个人分享的经历的故事和感悟
- Java中重载与重写的区别
- 用Python实现的中英文互译的小脚本
- 并发问题如何避免
- SpringMVC中使用@RequestBody,@ResponseBody注解实现Java对象和XML/JSON数据自动转换(上)