Skip to content

Instantly share code, notes, and snippets.

View tom-wagner's full-sized avatar

Tom Wagner tom-wagner

View GitHub Profile
@tom-wagner
tom-wagner / day2.js
Last active January 8, 2019 19:23
Advent of Code
/* ----------------------- PART 1 ----------------------- */
const countLetters = (string) => {
const seen = {};
const letters = string.split('');
_.forEach(letters, (char) => {
if (!seen[char]) {
seen[char] = 1;
} else {
seen[char]++;
}