1var powerfulIntegers = function (x, y, bound) {2 let ans = new Set();3 for (let xi = 1; xi < bound; xi *= x) {4 for (let yj = 1; xi + yj <= bound; yj *= y) {5 ans.add(xi + yj);6 if (y === 1) break;7 }8 if (x === 1) break;9 }10 return Array.from(ans);11};
WPM •0 •0
ACC •0 •0
TIME •0