Similar Password (Singapore)

Problem Overview

  • Determine the minimum operations to make a lowercase password "similar," meaning the count of vowels equals the count of consonants.
  • Input: string password; Output: int operations; one operation increments or decrements one character (a can't decrement, z can't increment); vowels are a, e, i, o, u.
  • Set in a password detection system for HackerRank accounts, reflecting a security/validation domain.
  • A Paypal interviews coding interview problem and common interview question.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: