Distinct palindromes within decimal numbers: Difference between revisions
Distinct palindromes within decimal numbers (view source)
Revision as of 20:28, 14 July 2023
, 10 months ago→{{header|Sidef}}: update
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
m (→{{header|Sidef}}: update) |
||
Line 810:
gather {
for a in (0..arr.end), b in (a .. arr.end) {
var sublist = arr.
take(sublist) if (sublist == sublist.flip)
}
Line 823:
123456832098769, 12345679432098769, 1234567905432098769, 123456790165432098769,
83071934127905179083, 1320267947849490361205695, "amanaplanacanalpanama"].each {|n|
var p = palindromes(n.kind_of(Number)
say ("#{'%25s'
p.sort.map{.join}.sort_by{.len}.join(' '))
}</syntaxhighlight>
|