Question: Need help in java please! Thanks You would like to set a password for an email account. However, there are two restrictions on the forma

Need help in java please! Thanks

Need help in java please! Thanks You would like to set a

You would like to set a password for an email account. However, there are two restrictions on the forma of the password. It has to contain at least one uppercase character and it cannot contain any digits. You are given a string S consisting of N alphanumerical characters. You would like to find the longest substring of S that is a valid password. A substring is defined as a contiguous segment of a string. For example, given "", the substrings that are valid passwords are "B" and "Ba". Note that "" is n substring and "aes" is not a valid password. Write a function: class Solution public int solution(String S); of N characters, returns the length of its longest substring th is a valid password. If there is no such substring, your function should return -1. For example, given "", your function should return 2, as explained above. Given "aebb", your function should return -1, since there is no substring that satisfies the restrictions on the format of a valid password Assume that: N is an integer within the range [1.200]; string S consists only of alphanumerical characters (a-z and/or A-Z and/or e-9). In your solution, focus on correctness. The performance of your solution will not be the focus of the assessment

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!