Project Euler — Problem 206 Solution

Problem

Find the unique pos­i­tive inte­ger whose square has the form 1_2_3_4_5_6_7_8_9_0,

where each “_” is a sin­gle dig­it.

Solution

Ini­tial­ly I start­ed solv­ing this prob­lem by cre­at­ing all per­mu­ta­tions of 19 dig­its num­bers which fits the required pat­tern and iter­a­tive­ly square root­ing them to find a square root which is a whole num­ber. Unfor­tu­nate­ly thanks to round­ing errors this approach doesn’t give me the cor­rect answer so I resort­ed to iter­at­ing through the square roots and brute forc­ing it instead.