#! /usr/bin/env python
# https://www.codechef.com/viewsolution/22092341
test_cases_count = int (input("Number of test cases: "))
solution_count_on_decision = []
problem_count_on_decision = []
day_vs_solved_dict = {}
day_vs_problem_dict = {}
for test in range(test_cases_count):
work_days_count = int(input("Number of working days : "))
day_vs_solved_dict = {}
for day in range(work_days_count):
work_date, solved_count = input().split()
day_vs_solved_dict[int(work_date)] = int(solved_count)
scenario_count = int(input("Number of scenarios: "))
day_vs_problem_dict = {}
for day in range(scenario_count):
scenario_date,problem_count = input().split()
problem_count_on_decision.append(int(problem_count))
day_vs_problem_dict[int(scenario_date)] = int(problem_count)
solution_count_on_decision.append(
sum( solved_count for work_date,solved_count
in day_vs_solved_dict.items()
if work_date <= int(scenario_date)))
for index in range(scenario_count):
print("Go Sleep" if solution_count_on_decision[index] < problem_count_on_decision[index] else "Go Camp")
This is my solution to https://www.codechef.com/problems/CAMPON
When I submit, it says wrong answer, however it gives correct answer. Any insight about what may be going wrong will be appreciated