Problem 24 in js - such brute force... much wow...