You are reading a single comment by @rhowe and its replies. Click here to read the full conversation.
  • Still catching up. Day 9 part 1 was quite easy in ansible

    - hosts: localhost
      gather_facts: no
      vars:
        input_file: input
        preamble: 25
      tasks:
        - name: Read program
          set_fact:
            numbers: "{{ lookup('file', input_file).splitlines() | list | map('int') | list }}"
        - name: Bonza
          debug: msg="{{ item }}"
          loop: "{{ numbers[preamble | int:] }}"
          loop_control:
            index_var: idx
          when: item not in numbers[idx:idx + preamble | int] | list | product(numbers[idx:idx + preamble | int] | list) | map('sum') | list
    
About

Avatar for rhowe @rhowe started