Given two arrays of strings list1 and list2, find all common strings that have the minimum index sum.
A common string is a string that appears in both list1 and list2. The index sum of a common string is defined as the sum of its list1 and its list2.
Return a list of all common strings with the smallest index sum. You may return the answer in any order.
Constraints:
list1.length, list2.length
list1[i].length, list2[i].length
list1[i] and list2[i] consist of spaces ' ' and English letters.
All strings in list1 are unique.
All strings in list2 are unique.
There is at least one common string between list1 and list2.
Given two arrays of strings list1 and list2, find all common strings that have the minimum index sum.
A common string is a string that appears in both list1 and list2. The index sum of a common string is defined as the sum of its list1 and its list2.
Return a list of all common strings with the smallest index sum. You may return the answer in any order.
Constraints:
list1.length, list2.length
list1[i].length, list2[i].length
list1[i] and list2[i] consist of spaces ' ' and English letters.
All strings in list1 are unique.
All strings in list2 are unique.
There is at least one common string between list1 and list2.