---
title: "Discussion on \"Advent of Code 2020: Day 2 (Ruby solution)\" | Hashnode"
description: "Discussion on \"Advent of Code 2020: Day 2 (Ruby solution)\". This time, the tasks are to count valid passwords from a text file.\nEach line of text contains two numbers, a letter, and a password. Example input:\n1-8 n: dpwpmhknmnlglhjtrbpx\n11-12 n: frpknnndpntnncnnnnn\n4-8 t: tmttdtnttkr\n12-18 v: vvvvvvvqvvvvvqvv..."
url: "https://hashnode.com/posts/advent-of-code-2020-day-2-ruby-solution/5fc7889aff636d4f4984c71c"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Advent of Code 2020: Day 2 (Ruby solution)](https://rubywizards.com/advent-of-code-2020-day-2-ruby-solution?utm_source=hashnode&utm_medium=feed)

This time, the tasks are to count valid passwords from a text file. Each line of text contains two numbers, a letter, and a password. Example input: 1-8 n: dpwpmhknmnlglhjtrbpx 11-12 n: frpknnndpntnncnnnnn 4-8 t: tmttdtnttkr 12-18 v: vvvvvvvqvvvvvqvv...

Dec 2, 2020 · 1 min read · rubywizards.com  
Updated Apr 13, 2021  
Read the article

-   [#ruby](https://hashnode.com/tag/ruby)

## Written by

[Piotr Jurewicz](https://hashnode.com/@pjurewicz)

@pjurewicz · Łódź, Poland

  
[View profile](https://hashnode.com/@pjurewicz)

ruby on rails developer

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
