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.
If you're in python, the instructions are misleading. You can't modify any three lines of code, but have to modify the ones they expect you to. After i made the following three changes, it worked for me as of May 10 2024:
mid = int((n + 1)/2) --> mid = int((n - 1)/2)
ed = n - 1 --> ed = n - 2
ed = ed + 1 --> ed = ed - 1
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Zig Zag Sequence
You are viewing a single comment's thread. Return to all comments →
If you're in python, the instructions are misleading. You can't modify any three lines of code, but have to modify the ones they expect you to. After i made the following three changes, it worked for me as of May 10 2024:
mid = int((n + 1)/2) --> mid = int((n - 1)/2)
ed = n - 1 --> ed = n - 2
ed = ed + 1 --> ed = ed - 1