NewProject Coding is here — build features and fix bugs in real codebases with an AI assistantSee what's new

Design a task tracking system that stores tasks by unique IDs, supports updating task metadata, and retrieves task details on demand.

Implement the TaskManager class:

  • TaskManager() Initializes the task manager with an empty task store.

  • String addTask(int timestamp, String name, int priority) Adds a new task with the given name and priority. Returns the unique ID assigned to this task in the format "taskId<n>", where n is a sequential counter starting from 1. Tasks with identical names and priorities are allowed; each receives its own unique ID.

  • boolean updateTask(int timestamp, String taskId, String name, int priority) Updates the name and priority of the task identified by taskId. Returns true if the task exists and was updated, or false if taskId is not found.

Test Cases
Input
Output
Expected