Could Someone tell the optimal approach

Revision en2, by AJ__20, 2023-06-04 06:58:23

You are given an array of strings A of size N. You need to pick two strings Ai and Aj such that len(Ai)* len(Aj) is maximized. Is there a optimal solution that can be less than order of N*N? Thanks in advance. Edit : Sry, forgot to add the constraints : there was a condition stating those two strings should have no common characters, then what would be the optimal solution ?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English AJ__20 2023-06-04 07:08:06 64
en2 English AJ__20 2023-06-04 06:58:23 170
en1 English AJ__20 2023-06-02 21:52:39 252 Initial revision (published)