Day 15: Lens Library | Advent of Code 2023

Поделиться
HTML-код
  • Опубликовано: 11 янв 2025

Комментарии •

  • @lee-uq6pm
    @lee-uq6pm Год назад

    i still didnt understand how do you know to append in which box?
    i dont get the logic

    • @vegeta3993
      @vegeta3993 Год назад

      I implemented the "hashmap" as a list of dictionaries (python3). The list is 256 elements long, and the index of the list to either place the lens into or pop from is the result of the hashing algorithm developed in part 1 on the first letters in the current line in the sequence (ie. 'rn', 'cm', 'qp', ...). Hope that helps.