Ad
Code
Diff
  • how_many = lambda t, d: ((t - d) // 2, (t - d) // 2 + d)
    • def how_many(total, diff):
    • return (total - diff) // 2, (total - diff) // 2 + diff
    • how_many = lambda t, d: ((t - d) // 2, (t - d) // 2 + d)
Code
Diff
  • def how_many(total, diff):
        return (total - diff) // 2, (total - diff) // 2 + diff
    • def how_many(total, diff):
    • volley = (total - diff) // 2
    • basket = volley + diff
    • return volley, basket
    • return (total - diff) // 2, (total - diff) // 2 + diff