fork download
  1. #!/usr/bin/env js91
  2.  
  3. "use strict";
  4.  
  5. function Func(num, max) {
  6. const base = 1 + Math.floor(num / 10) * 10;
  7. return [...Array(9).keys()]
  8. .map(i => i + base)
  9. .filter((x) => x * (x % 10) <= max)
  10. .length;
  11. }
  12.  
  13. function main(args) {
  14. console.log(`N = ${Func(args[0], args[1])}`);
  15. }
  16.  
  17. main(scriptArgs);
Success #stdin #stdout 0.03s 17328KB
stdin
Standard input is empty
stdout
N = 0