Skip to content

A repository to track my algorithm submissions to the Rust track on Exercism.

Notifications You must be signed in to change notification settings

taearls/exercism-rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Exercism Rust

This repository is a monorepo tracking all my solutions for the Rust track on Exercism's learning platform in a centralized location. If you're interested, check out my Exercism profile!

Including solutions for all the 100+ exercises here would get unwieldy quick. However, I will point out some of my favorites in the table below, including a link to the Exercism prompt, a link to my solution, and a brief explanation of what I learned.

Overall, I have really enjoyed learning Rust via Exercism. After reading the Rust book, I found myself wanting to put it into practice, but I was overwhelmed by the wide domain of problems Rust is able to solve: Do I make a web app (yes, as it turns out!), a microservice, a video game, or something else entirely? So many possibilities arose that, at first glance, it stifled me. Exercism guided my learning and helped me feel comfortable using the standard library and popular Rust crates to implement idiomatic solutions.

My Favorite Solutions (sorted alphabetically)

Name Link to Exercism challenge Link to my solution What I learned
Affine Cipher Exercise Solution I learned about the affine cipher algorithm, which is a rudimentary way of encoding a message by substituting alphabetic letters.
Atbash Cipher Exercise Solution I learned about the atbash cipher algorithm, which is a rudimentary way of encoding a message by using the alphabet in reverse order.
Binary Search Exercise Solution I wrote a basic implementation of the binary search algorithm. I liked how Rust's standard library enabled me to write a clean, functional solution with zero cost abstractions. Solutions like this became good exercises for my foray into studying functional programming patterns.
Crypto Square Exercise Solution I liked this challenge because it was an interesting method of encoding and decoding a plain text message by slicing it into rows that make up a square, and then traversing that square. This helped me solidify working with vectors in Rust.
Dot DSL Exercise Solution I liked this challenge because it provided me a simple use case for a Domain Specific Language (DSL) to implement. This exercise was my first applied experience working with modules in Rust and learning how to publically expose structs and functions so that other files (e.g., unit tests), can use them.
Largest Series Product Exercise Solution As a former high school mathlete, I love implementing number theory in code. This one was interesting because it required me to process individual digits within a given number to calculate the right value.
Luhn Exercise Solution I learned about the Luhn algorithm, which is used to validate a variety of identification strings, such as credit card numbers. I wasn't aware of this algorithm prior to this exercise, so it was especially valuable as a learning exercise to implement this in idiomatic Rust.
Platform as a Service (PaaS) I/O Exercise Solution This exercise taught me a basic way of tracking byte sizes in file system I/O. It was a great practical exposure to the Read and Write traits in the Rust standard library.
Palindrome Products Exercise Solution This was a fun algorithm to implement. The most difficult challenge arose when the scale drastically increased in the unit tests. By enabling one unit test to check for the smallest and highest palindrome products in a range of 1000..=9999 (all 4 digit numbers), my naive approached added over a minute to the total test execution time. As a result, this solution was timing out on Exercism when I submitted it. I had to drastically rethink my approach, which mostly involved not constantly allocating memory by writing to a vector while looping through the range of numbers. Sometimes using for loops with local state and break/continue statements are the best option for performance.
Spiral Matrix Exercise Solution I liked this problem because it pushed me to go the extra mile to get a working solution that was as clean as possible. To that end, I added a Direction enum to describe which way I was traversing the given spiral matrix, which enabled me to use a match statement to cleanly organize my code. I also used tuples to describe the vertical and horizontal positions of the bounding corners of the matrix. Now, in its current state, this solution is much easier to read, and feels like idiomatic Rust code.
Two Bucket Exercise Solution I thought this challenge was cool, but it was surprisingly difficult to get a solution working with all the unit test cases. Frankly, you can probably tell how long this exercise took me to complete by how not clean this solution is; a lot of muscle went into this one. I may go back and revisit this later, but for now I like that my implementation demonstrates how you can use Rust's looping syntax to get down and dirty with nested complexity.
Variable Length Quantity Exercise Solution This exercise taught me about the Variable Length Quantity (VLQ) algorithm, which is used to encode and decode binary strings. As someone with a strong professional background in web development, truth be told I had rarely ever written code in this domain prior to this challenge. After conducting a lot of research into bitwise operations, learning how to read non-trivial binary and hexadecimal values, and putting it into practice, my working solution demonstrates that I can write low level binary algorithms.

About

A repository to track my algorithm submissions to the Rust track on Exercism.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages