Project Euler Solution 4: Largest palindrome product

This is part of the Project Euler series, this is about Problem 4: Largest palindrome product. It is about finding a palindromic number made up as a product of two three digit numbers.

A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99.

Find the largest palindrome made from the product of two 3-digit numbers.

I don't know of any number theory tricks to make this faster. So I just do a grid search of all three digit numbers and check whether the product is a palindrome number. I make sure that I don't check the same product twice. For the palindrome property I use strings, and I only create these strings if the product really is larger than the largest palindrome that I have already found.

def solution_grid_search() -> int:
    largest = 0
    for i in range(100, 1000):
        for j in range(i, 1000):
            product = i * j
            if product > largest and str(product) == str(product)[::-1]:
                largest = product
    return largest

This produces the number 906,609 within 31 ms, and that seems to be fast enough.

That problem was rather simple and didn't really need any insights. Perhaps the needed insight was a way to check the palindrome property, which can be hard with other programming languages or when one doesn't want to use strings. I guess with Python we have been able to skip a few hard parts.