this question seems fairly simple, yet there is a very interesting and optimized solution
No download links available.