Math🥸/Project Euler

4. Largest Palindrome Product

lie_ji 2024. 12. 8. 22:06

제일 큰 대칭수 찾기 문제 

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

3자리숫자 두개를 곱했을 때 최댓값의 대칭수를 찾는 문제

1. -1했을 때 같은지를 판단하는 def를 먼저 만든다.

for i in range(999, 99, -1):
    for j in range(i, 99, -1):
        product = i * j
        만약 -1했을때 같은지 판별했을떄
             제일 큰수에넣어줌 = product를

906609