Luhn algorithm in Elixir: implementation, refactoring, and benchmarking

Some time ago, I have encountered a programming exercise in which the goal was to implement Luhn algorithm for credit card number validation. At first I implemented the algorithm in Ruby and then decided to implement it in Elixir. Eventually, I like how Elixir version looks like. In this article Elixir 1.2.2 is being used. Initial version It is assumed that credit card numbers are being read from a file and that check digit is included in a credit card number. [Read More]

A challenge: remove tags from a string.

Recently I have implemented a small piece of functionality, which is suitable to be a small challenge. Description Given a string with opening and closing tags (e.g., <mark></mark>), return a string without tags and indices of opening and closing tags. For example, given a string: "we eat <mark>healthy</mark> and <mark>tasty</mark> food." We expect to receive a string: "we eat healthy and tasty food.", and an array with pairs of indices: [[7, 14], [19, 24]]. [Read More]