This project is a simple C# console application written to solve the given coding puzzle.
The program prints two required outputs in the structure requested.
- I approached this as an opportunity to learn and practice the basics of C#.
- Since the outputs were explicitly defined and fixed, I chose a straightforward solution using lists of strings and simple loops to print them.
- My focus was on correctness, readability, and getting a working result within the given time.
- With more time and some more learning, I would tried make the program dynamic by parsing the input string into a tree structure and printing it recursively.
- I began sketching this idea after some deep googling in the commented-out code included in the project (
Node
,Parser
, and recursive printing). - That direction would make the program reusable, flexible, and able to handle arbitrary inputs instead of hardcoded lists.
- Pros:
- Simple, clear, and easy to follow
- Guaranteed to match the required outputs
- Cons:
- Not dynamic — changes to the input would require updating the hardcoded data
- A parser/tree approach would provide greater flexibility
Ensure the .NET SDK is installed, then run:
dotnet run