Added DP #126 in JS and Ruby