Problem · Hash Table
Return Records 🥝
Learn this problemProblem statement
As an intern at Amazon, you have been assigned a task to implement the sign-in pages in the Amazon Dummy Website.
There are three sign-in pages, each with its own API:
Given a log of API requests, return the list of returns from the mock website.
Notes:
Function
returnRecords(attempts: String[]) → String[]
Complete the function returnRecords in the editor below.
returnRecords has the following parameter:
string attempts[n]: each of the API requestsReturns
string[n]: an array of strings where #th string is the return value of the #th API request。゚🍓 ꒰ა Credit to neo݁ ໒꒱ 🍓 。゚
Examples
Example 1
attempts = ["register user05 qwerty", "login user05 qwerty", "logout user05"]return = ["Registered Successfully", "Logged In Successfully", "Logged Out Successfully"]
Check out the example image above 👆
Example 2
attempts = ["register david david123", "register adam 1Adam1", "login david david123", "login adam 1adam1", "logout david"]return = ["Registered Successfully", "Registered Successfully", "Logged In Successfully", "Login Unsuccessfully", "Logged Out Successfully"]
Constraints
More Amazon problems
- Secure Maximum DeliveriesOA · Seen Jul 2026
- Find Median from Data StreamONSITE INTERVIEW · Seen Jul 2026
- Handwritten SigmoidPHONE SCREEN · Seen Jul 2026
- Handwritten SoftmaxPHONE SCREEN · Seen Jul 2026
- Koko Eating BananasONSITE INTERVIEW · Seen Jul 2026
- Loyal Customers Across Two DaysONSITE INTERVIEW · Seen Jul 2026
- Maximum System Memory CapacityOA · Seen Jul 2026
- Package Delivery SystemOA · Seen Jul 2026