Programming Praxis – MindCipher
In today’s Programming Praxis exercise, our goal is to solve two exercises from the MindCipher website (technically three, but the third one can be solved without programming). Let’s get started, shall...
View ArticleProgramming Praxis – Coin Change, Part 1
In today’s Programming Praxis exercise, our goal is to list all of the ways in which a target amount can be reached given a list of coin denominations. Let’s get started, shall we? import Data.List We...
View ArticleProgramming Praxis – The Seven Bridges of Königsberg
In today’s Programming Praxis exercise, our goal is to write a function that determines whether a given graph is a eulerian circuit, path, or neither and if so, to produce that path. Let’s get started,...
View ArticleProgramming Praxis – Egyptian Fractions
In today’s Programming Praxis exercise, our goal is to convert a given fraction to a sum of fractions with numerator 1. Let’s get started, shall we? import Data.Ratio The implementation is fairly...
View ArticleProgramming Praxis – Sets
In today’s Programming Praxis exercise, our goal is to implement a Set data structure. Let’s get started, shall we? import Data.Hashable import qualified Data.HashTable.IO as H import Data.List (sort)...
View ArticleProgramming Praxis – Longest Substring Of Two Unique Characters
In today’s Programming Praxis exercise, our goal is to find the longest substring consisting of only two characters in a string. Let’s get started, shall we? import Data.List First, we group identical...
View ArticleProgramming Praxis – 3SUM
In today’s Programming Praxis exercise, our goal is to find all groups of three numbers in a given list that sum up to 0, and to do so in O(n2). Let’s get started, shall we? import Data.List import...
View ArticleProgramming Praxis – A Programming Puzzle
In today’s Programming Praxis exercise, our goal is to write a function such that f (f n) = -n. Let’s get started, shall we? My first instinct was to define f as a 90 degree rotation using the complex...
View ArticleProgramming Praxis – J K Rowling
In today’s Programming Praxis exercise, our goal is to write a program to analyse whether two books were written by the same author. Let’s get started, shall we? import Data.Char import Data.List...
View ArticleProgramming Praxis – Bit Hacks
In today’s Programming Praxis exercise, our goal is to write three functions that use bit twiddling, namely one to determine a numbers sign, one to determine of the signs of two numbers are equal and...
View Article