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.
No need to apologize. Pascal has proven to be one of the best languages for learning to code and IMHO it is perfectly ok here.
PS: I tested a completely different algorithm written in Pascal for this same exercise and it also failed the 3rd test case without any clue as to why. You have probably uncovered a bug/error in the test case specifically when run through the pascal compiler. I tried a "try/except" construct (guessing that the test failure might be due to a boundary condition) but this compiler implementation is gawing at the "try/except" construct itself and I haven't yet figured out why. If I find any repeatable means to confirm deny, I'll report.
PPS: using the same variable "i" in two different constructs that have completely different usages often causes pain. I'd choose a longer variable name. I'd also suggest using different names for different (obviously independant) variables based on their purpose/use.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Simple Array Sum
You are viewing a single comment's thread. Return to all comments →
No need to apologize. Pascal has proven to be one of the best languages for learning to code and IMHO it is perfectly ok here.
PS: I tested a completely different algorithm written in Pascal for this same exercise and it also failed the 3rd test case without any clue as to why. You have probably uncovered a bug/error in the test case specifically when run through the pascal compiler. I tried a "try/except" construct (guessing that the test failure might be due to a boundary condition) but this compiler implementation is gawing at the "try/except" construct itself and I haven't yet figured out why. If I find any repeatable means to confirm deny, I'll report.
PPS: using the same variable "i" in two different constructs that have completely different usages often causes pain. I'd choose a longer variable name. I'd also suggest using different names for different (obviously independant) variables based on their purpose/use.