Skip to main content

Accenture

Accenture OA-7 2024

Problem Description

You are given a string array of length N . Your task is to find and return an integer value representing the maximum permutation count of the strings after removing all the vowels from every element in the string array.

Notes:

  • If a string has no permutable characters (all characters are different), its permutation count is 0.
  • The strings can contain both uppercase and lowercase letters.

Input Format:

  • input1: A string array of length N.
  • input2: An integer N representing the size of the string array.

Output Format:

Return an integer value representing the maximum permutation count among the string elements.

Constraints:

  • 1 ≤ N ≤ 100
  • 1 ≤ |str[i]| ≤ 100

Example

Sample Input:

input1: ("hello", "ccbc", "aseliou")
input2: 3

Sample Output:

5040

Explanation:
"hello"
: There are 5 distinct characters, so the number of permutations is 5! = 120.

  • "ccbc": There are 2 'c's and 2 'b's, so the number of permutations is 4! / (2! * 2!) = 6.
  • "aseliou": There are 7 distinct characters, so the number of permutations is 7! = 5040.

Therefore, the maximum permutation count is 5040, which would be the output.