21
Last seen 1 year ago
Member for 10 years, 7 months
Difficulty Normal
Hello stranger,
if condition:
return True
else:
return False
is same as:
return condition
and one more, str has [endswith](https://docs.python.org/2/library/stdtypes.html#str.endswith)
More
or with generator:
count_inversion = lambda nums: sum(1 for i in combinations(list(nums), 2) if i[0] > i[1])
More