Current collected state Current
Observed since 20 Oct, 21:07 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
afivmax
Interview problem of Ant Fin
pip install afivmax
from afivmax.afivmax import afiv_max
# args
assert 3 == afiv_max(1, 2, 3)
assert 3 == afiv_max(3, 3, 3)
# args with key
assert 3 ==afiv_max(1, 2, 3, key=lambda x: x ** 2)
class TmpClass:
def __init__(self, x):
self.val = x
assert 9 == afiv_max(*[TmpClass(x) for x in range(10)], key=lambda x: x.val).val
# iterables
assert 3 == afiv_max([1, 2, 3])
assert 3 == afiv_max([3, 2, 1])
assert 3 == afiv_max([3])
# iterables with keys
assert 3 == afiv_max([1, 2, 3], key=lambda x: x ** 2)
assert 9 == afiv_max([TmpClass(x) for x in range(10)], key=lambda x: x.val).val
# iterables with default
assert 10 == afiv_max([], default=10), "iterable with default only"
Download counts and popularity will appear here as the collector receives them.
Declarations describe requirements; they are not a resolved dependency graph.
sdist · 2.72 KB · Python source
Observed since 20 Oct, 21:07 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:6c42bf1fd3dd6a0bbc9ae978da86e656a3a57a4cac7137d50463875dd2e5ecde