This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule Day4 do | |
| def run() do | |
| 138_307..654_504 | |
| |> Enum.map(&number_to_digits/1) | |
| |> Enum.reduce(0, fn digits, count -> | |
| if valid_password?(digits) do | |
| count + 1 | |
| else | |
| count | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule Day3Part2 do | |
| @central_port {0, 0} | |
| def run() do | |
| p1 = read_path() | |
| p2 = read_path() | |
| intersection(p1, p2) | |
| |> Enum.reject(¢ral_port?/1) | |
| |> Enum.map(fn pos -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule Day3 do | |
| @central_port {0, 0} | |
| def run() do | |
| p1 = read_path() | |
| p2 = read_path() | |
| intersection(p1, p2) | |
| |> Enum.reject(¢ral_port?/1) | |
| |> Enum.map(&manhattan_distance/1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| open Base | |
| open Stdio | |
| type program = (int array) * int | |
| type opcode = Add | Multiply | Halt | |
| type instruction = opcode * int * int * int | |
| let opcode_of_int = function |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| open Base | |
| open Stdio | |
| type program = (int array) * int | |
| type opcode = Add | Multiply | Halt | |
| let opcode_of_int = function | |
| | 1 -> Add | |
| | 2 -> Multiply |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| open Base | |
| open Stdio | |
| let calc_fuel mass = mass / 3 - 2 | |
| let rec get_fuel acc mass = | |
| match mass with | |
| | m when m <= 0 -> acc | |
| | m -> | |
| let fuel = calc_fuel m in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="ko"> | |
| <head> | |
| <title>assumedOverlap Fail</title> | |
| <meta name="viewport" | |
| content="user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, width=device-width"/> | |
| <style> | |
| div { padding: 20px;} | |
| </style> | |
| </head> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="ko"> | |
| <head> | |
| <meta name="viewport" content="user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, width=device-width, target-densityDpi=medium-dpi" /> | |
| <title>align text node with flexbox</title> | |
| <style> | |
| .box { | |
| background: #ddd; | |
| width: 300px; | |
| height: 200px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> |
NewerOlder