baodeptraihihi/lmao-code — reverse-engineered prompt

Reverse engineered prompt

GitHub

Build me a small C++ console program in a single file called bestfriends.cpp. I do not have a README for this, so please infer the likely goal from the filename and common programming challenge patterns, and turn it into a clean, working solution that reads from standard input and prints the correct result.

Keep it simple and practical. I want something that would feel ready to submit for a coding challenge, so it should be efficient, handle edge cases, and avoid unnecessary extras. Please write it in a clear style with a short comment at the top explaining what problem you think it is solving and how the approach works. If the exact problem is ambiguous, choose the most reasonable interpretation and make that obvious in the comments.

Also add a few example inputs and expected outputs in comments so I can test it quickly. If you need to, look up similar best friends competitive programming problems online before coding.

Want more depth? Deep Reverse