Sha256: 4cb9fce280fb036b8f12d4b682642f001bd52e5158caa85e6e2b74388926405e

Contents?: true

Size: 242 Bytes

Versions: 91

Compression:

Stored size: 242 Bytes

Contents

def square_of_sum(count):
    sum_ = count * (count + 1) / 2
    return sum_ * sum_


def sum_of_squares(count):
    return sum(m * m for m in range(count + 1))


def difference(count):
    return square_of_sum(count) - sum_of_squares(count)

Version data entries

91 entries across 91 versions & 1 rubygems

Version Path
trackler-2.2.1.119 tracks/python/exercises/difference-of-squares/example.py
trackler-2.2.1.118 tracks/python/exercises/difference-of-squares/example.py
trackler-2.2.1.117 tracks/python/exercises/difference-of-squares/example.py
trackler-2.2.1.116 tracks/python/exercises/difference-of-squares/example.py
trackler-2.2.1.115 tracks/python/exercises/difference-of-squares/example.py
trackler-2.2.1.114 tracks/python/exercises/difference-of-squares/example.py
trackler-2.2.1.113 tracks/python/exercises/difference-of-squares/example.py
trackler-2.2.1.111 tracks/python/exercises/difference-of-squares/example.py
trackler-2.2.1.110 tracks/python/exercises/difference-of-squares/example.py
trackler-2.2.1.109 tracks/python/exercises/difference-of-squares/example.py
trackler-2.2.1.108 tracks/python/exercises/difference-of-squares/example.py
trackler-2.2.1.107 tracks/python/exercises/difference-of-squares/example.py
trackler-2.2.1.106 tracks/python/exercises/difference-of-squares/example.py
trackler-2.2.1.105 tracks/python/exercises/difference-of-squares/example.py
trackler-2.2.1.104 tracks/python/exercises/difference-of-squares/example.py
trackler-2.2.1.103 tracks/python/exercises/difference-of-squares/example.py
trackler-2.2.1.102 tracks/python/exercises/difference-of-squares/example.py
trackler-2.2.1.101 tracks/python/exercises/difference-of-squares/example.py
trackler-2.2.1.100 tracks/python/exercises/difference-of-squares/example.py
trackler-2.2.1.99 tracks/python/exercises/difference-of-squares/example.py