aoc-2019-c

Advent of Code 2019 Solutions in C
git clone https://git.sinitax.com/sinitax/aoc-2019-c
Log | Files | Refs | README | sfeed.txt

part1 (923B)


      1--- Day 4: Secure Container ---
      2
      3You arrive at the Venus fuel depot only to discover it's protected by a password.  The Elves had
      4written the password on a sticky note, but someone threw it out.
      5
      6However, they do remember a few key facts about the password:
      7
      8
      9 - It is a six-digit number.
     10
     11 - The value is within the range given in your puzzle input.
     12
     13 - Two adjacent digits are the same (like 22 in 122345).
     14
     15 - Going from left to right, the digits never decrease; they only ever increase or stay the same
     16(like 111123 or 135679).
     17
     18
     19Other than the range rule, the following are true:
     20
     21
     22 - 111111 meets these criteria (double 11, never decreases).
     23
     24 - 223450 does not meet these criteria (decreasing pair of digits 50).
     25
     26 - 123789 does not meet these criteria (no double).
     27
     28
     29How many different passwords within the range given in your puzzle input meet these criteria?
     30
     31