You are viewing a single comment's thread. Return to all comments →
import math import os import random import re import sys import bisect #
#
def pylons(k, arr): n=len(arr) List=[] for i in range(n): if arr[i]==1: List.append(i) end=-1 ans=0 istart=0 while end
if name == 'main': fptr = open(os.environ['OUTPUT_PATH'], 'w')
first_multiple_input = input().rstrip().split() n = int(first_multiple_input[0]) k = int(first_multiple_input[1]) arr = list(map(int, input().rstrip().split())) #ADITYA SHARMA result = pylons(k, arr) fptr.write(str(result) + '\n') fptr.close()
Seems like cookies are disabled on this browser, please enable them to open this website
Goodland Electricity
You are viewing a single comment's thread. Return to all comments →
!/bin/python3
import math import os import random import re import sys import bisect #
Complete the 'pylons' function below.
#
The function is expected to return an INTEGER.
The function accepts following parameters:
1. INTEGER k
2. INTEGER_ARRAY arr
#
def pylons(k, arr): n=len(arr) List=[] for i in range(n): if arr[i]==1: List.append(i) end=-1 ans=0 istart=0 while end
if name == 'main': fptr = open(os.environ['OUTPUT_PATH'], 'w')