An algorithm is also welcome.

Similar questions and discussions