NewProject Coding is here — build features and fix bugs in real codebases with an AI assistantSee what's new

A social network app tracks user registration, friendships, and money transfers using a sequence of API request pairs. Each request is represented as a pair [<sequenceNumber>, <requestString>]:

  • The first value, sequenceNumber, is a unique string identifier for that request (such as "1", "2", ...).

  • The second value, requestString, describes the action and is formatted as one of the following:

    • "REGISTER: "v1/REGISTER/{user}/{initialBalance}" Registers a new user user with an initial balance of initialBalance.

    • "FRIEND_REQUEST": "v1/FRIEND_REQUEST/{fromUser}/{toUser}" Sends a pending friend request from fromUser to toUser. Store the request using its sequenceNumber.

Test Cases
Input
Output
Expected