[Solution] New Password Solution Round C 2022 - Kick Start 2022
Problem
A company named Gooli has issued a new policy that their employees account passwords must contain:
- At least characters.
- At least one uppercase English alphabet letter.
- At least one lowercase English alphabet letter.
- At least one digit.
- At least one special character. There are four special characters:
#
,@
,*
, and&
.
The company has asked all the employees to change their passwords if the above requirements are not satisfied. Charles, an employee at Gooli, really likes his old password. In case his old password does not
satisfy the above requirements, Charles will fix it by appending letters, digits, and special characters. Can you help Charles to find the shortest possible new password that satisfies his company's requirements?
Input
The first line of the input gives the number of test cases, . test cases follow. Each test case consists of two lines. The first line of each test case contains an integer , denoting the length of the old password.
The second line of each test case contains the old password of length . Old password contains only digits, letters, and special characters.
Output
For each test case, output one line containing Case #:
, where is the test case number (starting from 1) and is a valid new password, obtained by possibly fixing the old password in the way that Charles wants and satisfying the company's requirements.
It is guaranteed that at least one solution exists. If there are multiple solutions, you may output any one of them.
Limits
Time limit: 20 seconds.
Memory limit: 1 GB.
.
Test Set 1
.
The old password contains only digits.
Test Set 2
.
The old password contains only digits, letters, and special characters.
No comments:
Post a Comment