My Online Qualification Round Submission for Google HashCode 2020
datasets/
- Contains test casesoutput_*.txt
- Generated Output FilesHashCode2020_ProblemStatement.pdf
- Problem Statement of HashCode 2020Library.java
- Library Class containing all details of Library- Getters and Setters for Library data as required
ScanningFacility.java
- Blue Print of how Scanning Facility is designedaddLibrary(Library, current_day)
- Function for signing up library to the scanning facilityscanStrategy(allLibraries)
- Contains the scanning strategy for the scanning facilitymakeSubmission()
- Contains the code to write tooutput_*.txt
filesbookScores
- Variable containing mapping of scores against bookssignedUpLibraries
- Variable containing the list of signedUpLibrariesbooksScanned
- Contains the books scanned by libraries till nowlib2BookIDs
- Contains a mapping of books scanned against librarybookScoreComparator
- Comparator that sorts the books by scores currently in booksScoressignUpLibraryComparator
- Comparator to sort and identify which library to sign upMain.java
- The main class filebookScores
- Global Variable contains mapping of scores against booksbooks, libraries, maxDays
- Distinct Books, Libraries and Total Days given in inputreadAndExecute(filePath)
- Reads from input file and write result to file
- Step 1 : Add input data to variables
- Step 2 : Identify Library to signup at the Scanning Facility using
signUpLibraryComparator
- Step 3 : Identify which Books to scan in the Library selected in Step 2 using
bookScoreComparator
- Step 4 : Remove books that are already scanned from Step 3 using
booksScanned
- Step 5 : Add newly scanned books to
booksScanned
and removing this library from the set of libraries - Step 6 : Update the results of Step 2 and Step 3 to
lib2BookIDs
- Step 7 : Write Output to
output_*.txt
- Online Round Standing - 9295th Rank
- Extended Round Standing - 2834th Rank
- Fill README.md
- Comment the code