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.
WTF. It took me an entire noon to figure it out and ultimately I found that in C++, the data type of the variable used to receive the answer is INT. However, some answers of examples exceed 2^31 - 1. It should be LONG. Damn.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Balanced Forest
You are viewing a single comment's thread. Return to all comments →
WTF. It took me an entire noon to figure it out and ultimately I found that in C++, the data type of the variable used to receive the answer is INT. However, some answers of examples exceed 2^31 - 1. It should be LONG. Damn.