A task export contains root tasks and subtasks. You are given records, an array of comma-separated strings in two formats:
"<timestamp>,task,<taskId>,<taskName>"defines a root task."<timestamp>,subtask,<parentId>,<taskId>,<taskName>"defines a subtask whose parent has IDparentId.
The timestamp is an opaque field and does not determine display order.
Ask AI Assistant

Ask AI Assistant
Ask me anything about this coding question!
Test Cases
Input
Output
Expected