Skip to content

Latest commit

 

History

History

day_5

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Day 5

Some not great programming again here but go it done...

Part 1

Create hash map of orders with vector of corresponding values.

Iterate through updates verifying that all values to the right of current value are in the "allowed values" vector in the hash map.

Part 2

Find all invalid updates, perform bubble sort based on the hash map used previously.

Replace value with the value directly ahead of it in the vector if it belongs to it's associated values in the hash map.