标题:如何能简单判断两个字符串是否有相同字符?
取消只看楼主
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



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-467367-1-1.html




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

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