🐝 Hi there! The description you are currently reading is just 4th part of the problem set. It is highly recommended to read ALL THE 4 PARTS before coding as parts may build on top of each other 🐳
Last month, we received the new Payment Intent system you built 👏, and merchants have been LOVING how simple it makes accepting payments. Congratulations 🎉!
However, numerous merchants have requested that we augment our refund functionality by letting merchants specify a refund timeout policy: the amount of time after a payment succeeds that refunds are permitted. For example, one merchant, LlmaCorp, only wants to accept refunds within 15 days of a payment succeeding. Being able to return a llama afte 15 days would be absurd after all.
Let's add this functionality to our system, which means we will need to change the format of our commands to handle timing 💪.
Timestamps
Merchant Refund Timeout Limit
👉 <timestamp> INIT <merchant_id> <starting_balance> <refund_time_out_limit>
🌷༊·˚Credit to Rachelᥫ᭡.
commands = ["1 INIT m1 0 5", "2 CREATE p1 m1 100", "3 CREATE p2 m1 50", "4 ATTEMPT p1", "5 ATTEMPT p2", "8 SUCCEED p1", "10 SUCCEED p2", "11 REFUND p1", "16 REFUND p2"] return = ["m1 50"]
🫶
- Account Balance Manager Part 3 - Platform CoverageONSITE INTERVIEW · Seen Jun 2026
- BitFont Part 3 - Decode Run-Length-Encoded RowsONSITE INTERVIEW · Seen Jun 2026
- Record Linkage Part 3 - Full Connected ComponentPHONE SCREEN · Seen Jun 2026
- Shipping Cost Calculator Part 3 - Mixed Fixed/Incremental TiersONSITE INTERVIEW · Seen Jun 2026
- Transaction Fee Calculator - Per-Merchant Volume DiscountPHONE SCREEN · Seen Jun 2026
- Account Balance Manager Part 2 - Reject OverdraftsONSITE INTERVIEW · Seen Jun 2026
- BitFont Part 2 - Render a WordONSITE INTERVIEW · Seen Jun 2026
- Factory Cost - Min-Cost Path Skipping One StagePHONE SCREEN · Seen Jun 2026
public String[] forAllIntentsAndPurposes4(String[] commands) {
// write your code here
}