BackmediumUncategorized uncategorized medium

Generate Unique Book Codes Solution

Problem Statement

Given a list of books, each represented as a tuple of title, author, and publication year, generate a list of unique identifiers. The identifiers should be based on the book's information and ensure that no two books have the same identifier.

Example 1
Input
[['Book1', 'Author1', 2020], ['Book2', 'Author2', 2021]]
Output
["Book1_Author1_2020","Book2_Author2_2021"]

Explanation: A simple concatenation of title, author, and publication year can serve as a unique identifier.

Constraints

  • 1 <= number of books <= 1000
  • 1 <= length of title <= 50
  • 1 <= length of author <= 50
  • 1900 <= publication year <= 2100
Live Compiler
Loading...
Test Cases & Output
🔒 Sign up to run your code

🚀 Practice this problem

Run code, get AI hints & track streak

Sign Up Free