Skip to content

Commit 6ca9a80

Browse files
Arithmetic Number
1 parent 1f84ec6 commit 6ca9a80

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
class Solution:
2+
def inSequence(self, A, B, C):
3+
# code here
4+
if C==0:
5+
if A==B:
6+
return 1
7+
else:
8+
return 0
9+
elif A==B:
10+
return 1
11+
12+
elif C>0 and (B-A)%C==0 and B>A:
13+
return 1
14+
15+
elif C<0 and (B-A)%C ==0 and A>B:
16+
return 1
17+
18+
else:
19+
return 0

0 commit comments

Comments
 (0)