-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
40 lines (30 loc) · 676 Bytes
/
main.py
File metadata and controls
40 lines (30 loc) · 676 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from modules.point import Point
from math import factorial
a = Point(3,5)
b = Point(1,8)
print(a.distance(b))
cache = {}
# def get_factorial(n):
# if(cache.get(n)):
# return cache.get(n)
# value = factorial(n)
# cache[n] = value
# return value
# #
# # Complete the lights function below.
# #
# def lights(n):
# #
# # Write your code here.
# #
# sum =0
# for number in range(1,n+1):
# sum += get_factorial(n) // (get_factorial(n-number)* get_factorial(number))
# mod = 10 ** 5
# return sum % mod
def lights(n):
#
# Write your code here.
#
mod = 10 ** 5
return ((2 ** n) - 1) % mod