jkaplon / str-freq-sort

Small golang project to get frequency counts of characters within a sample string and (hopefully) reveal the secret word.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

str-freq-sort

One-off golang project to solve a coding challenge:

  • Take the sample string posted on a web page
  • Get frequency counts of characters
  • Order characters by frequency
  • And (hopefully) reveal the secret word

I chose golang for the project with the hopes of learning more about concurrency with goroutines and channels. That didn't work out. Instead, I ended up getting experience with golang's interfaces, and a couple new packages:

This repo also contains some basic unit tests that can be run with go test.

My results are published on my Docker Hub account. Give it a pull with docker pull jkaplon/str-freq-sort. Give it a try with docker run --rm --name str-freq-sort jkaplon/str-freq-sort.

In the process, I built a hacky-but-useful development docker image with auto-reload for Go web apps. The development branch contains the alternate Dockerfile with the auto-reload setup.

About

Small golang project to get frequency counts of characters within a sample string and (hopefully) reveal the secret word.

License:MIT License


Languages

Language:Go 100.0%