+ 2
Test case#1 keeps outputing 40 instead of hundred. And code works fine in my IDE. Please why is this
my_name= input() available_agents = int(input ()) other_names= input () _split=other_names.split(',') all_names = _split.append(my_name) _sorted = sorted(_split) _index= _sorted.index(my_name) +1 remainder = _index % available_agents if remainder == 2 : time = 20 * 2 print(time) elif remainder == 1 or remainder ==0: time =20 * ((_index % available_agents) + (_index // available_agents) ) print(time) elif available_agents > _index: print(20)
2 odpowiedzi
+ 4
Eleojo Emmanuel Adegbe
_sorted = sorted(_split)
Should be
_sorted = sorted(all_names)
+ 2
I solved it.. The problem was me splitting with comma "," instead of spaces" "