Jump to content

Self-describing numbers: Difference between revisions

Added 11l
(Added 11l)
Line 27:
*   [[Spelling of ordinal numbers]]
<br><br>
 
=={{header|11l}}==
{{trans|Python}}
 
<lang 11l>F is_self_describing(n)
V s = String(n)
R all(enumerate(Array(s)).map((i, ch) -> @s.count(String(i)) == Int(ch)))
 
print((0.<4000000).filter(x -> is_self_describing(x)))</lang>
 
{{out}}
<pre>
[1210, 2020, 21200, 3211000]
</pre>
 
=={{header|360 Assembly}}==
1,481

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.