Given an D-dimension array, where each axis is of length N, your goal is to find the sum of every index in the array starting from 0.

For Example if D=1 and N=10 then the answer would be 45 ([0,1,2,3,4,5,6,7,8,9])
If D=2 and N = 3 the answer is 18 which would be the sum of every number in the following:
```python
[
[(0,0), (0,1), (0,2)],
[(1,0), (1,1), (1,2)],
[(2,0), (2,1), (2,2)]
]
```

A naive solution could be to loop over every index in every dimension and add to a global sum. This won't work as the number of dimension is expected to be quite large.

Hint: A formulaic approach would be best
Hint 2: Gauss could solve the one dimensional case in his earliest of years, This is just a generalization.

~~~if:javascript
Note for JS version: Because the results will exceed the maximum safe integer easily, for such values you're only required to have a precision of at least `1 in 1e-9` to the actual answer.
~~~

Difficulty: introductory

Starter code:

def super_sum(D, N):
	

Solutions:
def super_sum(D, N):
    #Number of possible combinations of D length from set [0...N]
    num = pow(N,D)
    #2x average value of a combination; 2x because dividing results in float and loss of precision
    dblAvg = D*(N-1)
    #Multiply number of possible combinations by the avergae value; now use true division to ensure result is an integer
    return num*dblAvg//2

def super_sum(D, N):
    return (D*(N-1)*(N**D))//2

def super_sum(d,n):
    return (n**~-d*n*~-n*d)>> 0 >> 1

def super_sum(D, N):
    s = N * (N-1) // 2
    return s * D * N ** (D-1)

def super_sum(D, N):
    return (N ** D) * (D) * ((N - 1) // 2) if N % 2 else ((N ** D) // 2) * (D) * (N - 1)

def super_sum(D, N):
    return ((N - 1) * (N ** D * D)) // 2

super_sum=lambda d,n:(((n-1)*n//2)*(n**(d-1)))*d

def super_sum(D, N):
    #Make Gauss proud!
    count = 0
    result = 0
    while ((N -1) - count) >= 1:
        result += ((N-1) - count) * (N ** (D -1))
        count += 1
    return result * D

def super_sum(D, N):
    summe=0
    for i in range(0,N):
        summe+=i
    erg=summe*D*(N**(D-1))
    return erg