We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
def read_input():
import sys
input = sys.stdin.read
data = input().split()
webpatente b
T = int(data[0])
index = 1
test_cases = []
for _ in range(T):
N = int(data[index])
K = int(data[index + 1])
ratings = list(map(int, data[index + 2: index + 2 + N]))
test_cases.append((N, K, ratings))
index += 2 + N
return test_cases
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Problem solving
You are viewing a single comment's thread. Return to all comments →
Reading input and formatting it as required
def read_input(): import sys input = sys.stdin.read data = input().split() webpatente b T = int(data[0]) index = 1 test_cases = []