My code produces satisfied result in hacker rank compiler window for eleven out of fifteen test input in a certain problem. However, when i make subtle change in my code, all the the test inputs are run as OK.
This is a snippet of my previous code which shows error (terminated due to timeout).
for ind, letter in enumerate(string):
if letter in vowels:
kevin += len(string[ind:])
else:
stuart += len(string[ind:])
When i changed the above code as below all inputs are run successfully.
for ind, letter in enumerate(string):
if letter in vowels:
kevin += len(string) - ind
else:
stuart += len(string) - ind
Aren't these two codes equivalent?
indis an integer correct? I really don't know what you're trying to do here.