Skip to content
This repository has been archived by the owner on Oct 16, 2019. It is now read-only.

Commit

Permalink
add day 2
Browse files Browse the repository at this point in the history
  • Loading branch information
jlaswell committed Dec 3, 2018
1 parent 59a20f3 commit 658634b
Show file tree
Hide file tree
Showing 12 changed files with 55 additions and 0 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 22 additions & 0 deletions 2-sorter/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.PHONY: all
all: go js php py

.PHONY: go
go:
@echo "go"
docker run --rm -it `docker build -q -f go.Dockerfile .`

.PHONY: js
js:
@echo "js"
docker run --rm -it `docker build -q -f js.Dockerfile .`

.PHONY: php
php:
@echo "php"
docker run --rm -it `docker build -q -f php.Dockerfile .`

.PHONY: py
py:
@echo "py"
docker run --rm -it `docker build -q -f py.Dockerfile .`
21 changes: 21 additions & 0 deletions 2-sorter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Day 2 - Sort & Merge

> There are multiple elves that help Santa to keep track of all of the people on
> his list. Every person on the list has a unique number assigned to help
> identify him or her, but in order to work efficiently, the elves work in three
> groups. This causes people to be listed across the separate and exclusive
> lists.
>
> i.e. If Prof. Lawrence J. Hubert is assigned number 9780824776176 on list A,
> no other person will be assigned his number and he will not be on list B or
> list C.
Santa likes to review the list in numerical order, but the elves build each list
by randomly assigning the next person or any list.

Write a function that helps Jingles merge the three numerically sorted lists
into a new sorted list for Santa to review.

Example: [1,4,9],[3,5,8],[2,6,7][1,2,3,4,5,6,7,8,9]

Bonus: Can you sort into a new list without starting with an empty list?
3 changes: 3 additions & 0 deletions 2-sorter/go.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM golang:1-alpine
COPY sorter.go .
CMD [ "go", "run", "sorter.go" ]
3 changes: 3 additions & 0 deletions 2-sorter/js.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM node:lts-alpine
COPY sorter.js .
CMD [ "node", "sorter.js" ]
3 changes: 3 additions & 0 deletions 2-sorter/php.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM php:7-cli-alpine
COPY sorter.php .
CMD [ "php", "sorter.php" ]
3 changes: 3 additions & 0 deletions 2-sorter/py.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM python:3-alpine
COPY sorter.py .
CMD [ "python", "sorter.py" ]

0 comments on commit 658634b

Please sign in to comment.