An engineer is designing a system and needs to create valid passwords for it. However, the passwords must follow specific rules to be considered valid. Each password the engineer proposes must be evaluated to ensure it is valid according to these rules.
The engineer proposed N passwords, each passwords consisting of only lowercase English characters, where the ith password is denoted passwords[i]. Determine if each password is valid or not. A valid password is denoted by 1 in the answer array while an invalid password is denoted by 0.
Hard