Skip to content

11614: 【原1614】Maximum Product of Word Lengths

题目

题目描述

author: caroline 原OJ链接:https://acm.sjtu.edu.cn/OnlineJudge-old/problem/1614

Description

Given a string array words, find the maximum value of length(words[i])*length(words[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.

Note:

  • The string array words should be any size array with string type elements.
  • You need to consider at least char type and integer type.
  • The array size would not exceed 10000. Meanwhile, length(words[i]) would not be too large, for any element i.
  • Every element of the string array words should be separated by spaces.
  • If all elements share one letter at least, you should return 0.

Sample Input

6
abcw baz foo bar xtfn abcdef

Sample Output

16

Oops! 本题目还没有解答!

助教老师们编题的速度,已经超过了解题的速度!

OJ翻了一新,但本解答集还大多用的是2017-2019级,甚至更早的同学们贡献的答案。

如果你已经AC了,可以的话,请您参考添加页面,与大家一起分享你的题解!