| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 3114 人关注过本帖
标题:如何能简单判断两个字符串是否有相同字符?
取消只看楼主 加入收藏
qitengfei746
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2016-7-6
结帖率:0
收藏
已结贴  问题点数:20 回复次数:0 
如何能简单判断两个字符串是否有相同字符?
Given a string array words, find the maximum value of length(word[i]) * length(word[j]) where the two words do not share common letters. You may assume that each word will contain only lower case letters. If no such two words exist, return 0.

Example 1:


Given ["abcw", "baz", "foo", "bar", "xtfn", "abcdef"]
 Return 16
 The two words can be "abcw", "xtfn".

Example 2:


Given ["a", "ab", "abc", "d", "cd", "bcd", "abcd"]
 Return 4
 The two words can be "ab", "cd".

Example 3:


Given ["a", "aa", "aaa", "aaaa"]
 Return 0
 No such pair of words.
搜索更多相关主题的帖子: contain letters return common 字符串 
2016-07-29 20:22
快速回复:如何能简单判断两个字符串是否有相同字符?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015007 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved