连接两个字符串中的不同字符 lintcode python
来源:互联网 发布:国际空间站直播软件 编辑:程序博客网 时间:2024/06/05 19:19
给出两个字符串, 你需要修改第一个字符串,将所有与第二个字符串中相同的字符删除, 并且第二个字符串中不同的字符与第一个字符串的不同字符连接
样例
给出 s1 = aacdb
, s2 = gafd
返回 cbgf
给出 s1 = abcs
, s2 = cxzca
;
返回 bsxz
思路启发自博客连接两个字符串中的不同字符
class Solution: """ @param: : the 1st string @param: : the 2nd string @return: uncommon characters of given strings """ def concatenetedString(self, s1, s2): # write your code here s3='' for i in range(len(s1)): if s1[i] not in s2: s3=s3+s1[i] for i in range(len(s2)): if s2[i] not in s1: s3=s3+s2[i] return s3
阅读全文
0 0
- 连接两个字符串中的不同字符 lintcode python
- 连接两个字符串中的不同字符-LintCode
- python连接两个字符串切片
- python 中的字符串连接
- python中的字符串连接
- lintcode python— 两个字符串是变位词
- 字符串模型2:分别取一串字符串中的奇偶字符存放在两个不同的内存块中
- Lintcode 容易 python 判断字符串是否没有重复字符
- 判断字符串中的字符是否完全不同
- 统计字符串中的不同字符个数
- python:字符串中的转义字符
- 比较两个字符串中的字符,并交换
- C比较两个字符串中的不同的字符串
- LintCode 字符串置换 python
- LintCode-最多有k个不同字符的最长子字符串
- lintcode-最多有k个不同字符的最长子字符串
- LintCode:最多有k个不同字符的最长子字符串
- 使用全外连接比较两个数据表中的不同记录
- JQuery DataTables 隐藏搜索框 及 延迟搜索
- C#调式耗时
- java基础01
- Java8 Stream原理深度解析
- oracle批量添加数据
- 连接两个字符串中的不同字符 lintcode python
- 在使用visual studio 2013写程序时 ,出现了(“The POSIX name for this item is deprecated. Instead, use the ISO C+
- hdu 1290 切蛋糕
- Nginx实现反向代理(同一服务器下不同端口服务映射到80端口)
- Retrofit结合RxJava1.x使用
- AD导入logo
- TLP280-4 与 TLP281-4区别
- UVA 12034 Race
- 查询及删除重复记录的SQL语句