Save 25%Black Friday: 25% off all plans — use code BLACKFRIDAY2026 at checkout. Ends Monday, Dec 7.Claim the deal

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 ID parentId.

The timestamp is an opaque field and does not determine display order.

Test Cases
Input
Output
Expected