# Mathspp Blog

342 391,958 32,910
articles words lines of code
##### Hold my parentheses

Explore unusual Python features to solve the problem of determining whether an expression is properly parenthesised.

##### Longest unique substring

How can you find the longest substring that contains only unique characters?

##### Deducing physics formulas with genetic algorithms

This tutorial shows how to use a simple genetic algorithm to deduce physics formulas.

##### Biggest square

How can you find the biggest free square in a 2D map with obstacles?

##### N queens problem

This article shows how to solve the N queens problem in 20 lines of code.

##### TIL #077 – piece table data structure

Today I learned about the piece table data structure.

##### TIL #075 – Damerau-Levenshtein distance

Today I learned about the Damerau-Levenshtein distance used on strings in the field of genetics.

##### TIL #059 – skip list data structure

Today I learned about the skip list data structure.

##### TIL #008 – two pass join

Today I learned that the .join method in Python is a two-pass algorithm, and that's why joining a list comprehension is faster than a generator expression.

##### TIL #004 – C3 linearisation

Today I learned about an algorithm that Python uses to sort out inheritance.

##### Problem #021 - predicting coin tosses

Alice and Bob are going to be locked away separately and their faith depends on their guessing random coin tosses!

##### Problem #013 – circular train

Can you find out how many carriages this circular train has?

##### Water buckets riddle

Can you measure exactly $$2$$L of water with two plain buckets with volumes of $$14$$L and $$5$$L? Of course you can!