Trial and error, BUT with some logic!

You know leftmost digit can't be 1 or 3 or 5 or 7 or 9;

so start in 200000-299999 range;

sqrt(200000) = 447.213...;

so start with 448: 448^2 = 200704 ; no, has 7

next 450 (don't try 449 or any odd number: last digit will be odd);

450^2 = 202500 ; no, has 5

Carry on.