Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
8
maximum = int(input()) length = int(input()) a = [] r = 1 result = 0 for i in range(length): b=int(input()) a.append(b) while r != 0: r = 0 for i in range(len(a)): if r == 0: if a[i] == 1: result += 1 if length - i > maximum: a = a[:i] + a[i + maximum] else: a = a[:i] r += 1 print(result)
run
|
edit
|
history
|
help
0
Search for sum of pairs in given array
Rektangel
highest score question NPTEL
global 3
Ej2_python_204676887
My first experience on rextester !
pico menu
PyList
arjun chinese class
Butch