Add sorting to a comment list with persistence across refresh

Implement sorting for a comment list.

You have a list of comments; each comment has at least:

  • id: string/int
  • userId: string/int
  • timestamp: ISO string or epoch milliseconds
  • content: st...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: