Similar Password 🪴 (Singapore)
A password detection system for HackerRank accounts detects a password as similar if the number of vowels is equal to the number of consonants in the password.
Passwords consist of lowercase English characters only, and vowels are ('a', 'e', 'i', 'o', 'u').
To check the strength of a password and how easily it can be hacked, some manipulations can be made to the password. In one operation, any character of the string can either be incremented or decremented. For example, 'f' can be incremented to 'g', or decremented to 'e'. Note that character 'a' cannot be decremented and 'z' cannot be incremented.
Find the minimum number of operations in which the password can be made similar.
Complete the function countMinimumOperations in the editor below.
countMinimumOperations has the following parameter:
string password: the password
Returns
int: the minimum number of operations
1Example 1
2Example 2
3Example 3
Constraints
Limits and guarantees your solution can rely on.
Unknown for now