+ 1
On hackerrank the compiler used for doing practice for python had error , show wrong answer if the code is perfectly fine why??
Coding
8 Answers
+ 1
Perhaps the code itself is wrong.
Or the IDE is using another version of Python (e.g. Python 2, PyPy2, PyPy3).
0
Wouldn't it make more sense to tell hacker rank about an error at hacker rank?
0
It would help if you provided additional information. Hackerrank has memory and time limits so although your code is correct it may not be optimal. For example there is a practice test that requires to find the count of the maximum integer values in a list.
The first principals Python 3 code would be:
count = 0
for i in list:
if i == max(list):
count += 1
return count
However an optimal solution is:
return list.count(max(list))
Which uses a built in method
Hope that helps
0
Maybe your code output dont satisfy one of tests case though it satisfy others
0
KrOW no everything is fine because my output match the solution
0
Its not important than the output match the sample solution.... Exists many test cases just for this and your code has to output right data to all test cases
0
KrOW thanks
0
Whack Hack đđđ