Tap here to switch tabs
Problem
Submissions

Problem: Find Maximum Number of String Pairs

med
30 min
Try to solve the Find Maximum Number of String Pairs problem.

Statement

Given a 00 indexed array words consisting of distinct strings.

The string words[i] can be paired with the string words[j] if:

  • The string words[i] is equal to the reversed string of words[j].

  • 0≤i<j<0 \leq i < j < words.length.

Return the maximum number of pairs that can be formed from the array words.

Note: Each string can belong to at most one pair.

Constraints:

  • 1≤1 \leq words.length ≤50\leq 50

  • words[i].length =2= 2

  • words consists of distinct strings.

  • words[i] contains only lowercase English letters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Find Maximum Number of String Pairs

med
30 min
Try to solve the Find Maximum Number of String Pairs problem.

Statement

Given a 00 indexed array words consisting of distinct strings.

The string words[i] can be paired with the string words[j] if:

  • The string words[i] is equal to the reversed string of words[j].

  • 0≤i<j<0 \leq i < j < words.length.

Return the maximum number of pairs that can be formed from the array words.

Note: Each string can belong to at most one pair.

Constraints:

  • 1≤1 \leq words.length ≤50\leq 50

  • words[i].length =2= 2

  • words consists of distinct strings.

  • words[i] contains only lowercase English letters.