Tripartite Palindromic Partition of Integer (HP 50g) Challenge
|
02-17-2023, 07:37 AM
Post: #11
|
|||
|
|||
RE: Tripartite Palindromic Partition of Integer (HP 50g) Challenge
Here is another approach, n = x+y+z, greedy search for x, palindromes x >= y >= z > 0
OP example, x start with 8 implied y start with 0, "bad" palindrome. So, we backtrack a bit. We maxmize x, by first assume no carries (backtrack if necessary). Code: 808182838485868788 Maximize x implied y values start with 0 (y=0 → z=6 → c=1 → x=5) Code: 808182838485868788 Code: 808182838485868788 Code: 808182838485868788 Code: 808182838485868788 Code: 808182838485868788 Code: 808182838485868788 Code: 808182838485868788 808182838485868788 = 715559640046955517 + 90000000100000009 + 2623198338913262 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 3 Guest(s)