My attempt for reddit daily Programmer