Farz0l1x

Untitled

Jun 3rd, 2023
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. k_7 = 0
  2. k = 0
  3. ans = 0
  4. for i in range(len(A)):
  5. if A[i] % 7 == 0:
  6. ans += k
  7. else:
  8. ans += k_7
  9. k += 1
  10. if A[i] % 7 == 0:
  11. k_7 += 1
  12. print(ans)
Advertisement
Add Comment
Please, Sign In to add comment