Next highest int from digits: Difference between revisions
Content added Content deleted
(New draft task with python examples.) |
(→Python: Algorithm 2: Comment.) |
||
Line 57: | Line 57: | ||
=={{header|Python}}== |
=={{header|Python}}== |
||
===Python: Algorithm 2=== |
===Python: Algorithm 2=== |
||
Like Algorithm 2, but digit order is reversed for easier indexing, then reversed on return. |
|||
<lang python>def closest_more_than(n, lst): |
<lang python>def closest_more_than(n, lst): |
||
"(index of) closest int from lst, to n that is also > n" |
"(index of) closest int from lst, to n that is also > n" |
||
Line 95: | Line 96: | ||
95_322_020 -> 95_322_200 |
95_322_020 -> 95_322_200 |
||
9_589_776_899_767_587_796_600 -> 9_589_776_899_767_587_900_667</pre> |
9_589_776_899_767_587_796_600 -> 9_589_776_899_767_587_900_667</pre> |
||
===Python: Algorithm 1=== |
===Python: Algorithm 1=== |