Problem Brief
Sign In Pages π
INTERNOA
As an intern at Amazon, you have been assigned a task to implement the three sign in pages, each with its own API: Register, Login, Logout.
Notes:
Function Description
Complete the function signInPages in the editor.
signInPages has the following parameter:
String[] requests: an array of API requests
Returns
String[]: an array of responses for each API request
1Example 1
Input
requests = ["register david david123", "register adam 1Adam1", "login david david123", "login adam 1adam1", "logout david"]
Output
["Registered Successfully", "Registered Successfully", "Logged In Successfully", "Login Unsuccessful", "Logged Out Successfully"]
Explanation
The sequence of API requests and their corresponding responses are as follows:
register david david123- The user 'david' is registered successfully.register adam 1Adam1- The user 'adam' is registered successfully.login david david123- The user 'david' logs in successfully.login adam 1adam1- The login is unsuccessful because the password is case-sensitive and does not match the registered password '1Adam1'.logout david- The user 'david' is logged out successfully.