4th solution
1st version of 5th solution
optimized solution
6th solution