The TransCompilator

Solved LeetCode program · 674 of 1,000

#0906 · Super Palindromes

Hard String chunk-14.md

Original English source

Keep a shared reflection of 0. Keep a shared root of 0. Keep a shared total of 0. Keep a shared mirrorvalue of 0. The low is 4. The high is 1000.
To reverse from remaining (a whole number) with built (a whole number). If remaining is less than 1 and built is not mirrorvalue, set reflection to 0, return. If remaining is less than 1, return. The digit is remaining modulo 10. Reverse from remaining divided by 10 with built times 10 plus digit.

To mirror from value (a whole number). Set mirrorvalue to value. Set reflection to 1. Reverse from value with 0.

To seek from value (a whole number). Set root to 0.
Repeat while root times root is less than value.
Add 1 to root.

To inspect from value (a whole number). Mirror from value. If reflection is 0, return. Seek from value. If root times root is value and root is more than 0, Mirror from root, if reflection is 1, add 1 to total.

For every value from low to high.
Inspect from value.

Show total.

Open in Playground Browse all 1,000 problems

Expected stdout

4