Try to write a python implementation
Try to write a JavaScript implementation