Hint to Project Euler 206 - Concealed Square

What is your hint or solution suggestion?
Hint to Project Euler 206 - Concealed Square

Summary
function match(n) {
  n = n.toString();
  let j = 0;
  for (let i=1;i<10;i++) {
    if (parseInt(n[j]) != i) return false;
    j += 2;
  }
  return true;
}

function concealedSquare() {
  let n = 19293949596979899;
  let x = parseInt(Math.sqrt(n)) + 1;
  while (!match(x**2)) {
    x -= 2;
  }
  return x*10;
}

console.log(concealedSquare());

Challenge: Problem 206: Concealed Square

Link to the challenge:

Double check, this accidentally reaches the target number but is not a valid solution code. The squared values are outside of the normal range of integers. Also, you aren’t checking if 9 is present in the pattern.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.