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.
Once more, Java "skeleton code" (and I guess the ones for some other languages as well) uses wrong type. int is too small to handle all possible values.
E.g. for 2997 2998 2999 3000 result is 3380890906299.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Beautiful Quadruples
You are viewing a single comment's thread. Return to all comments →
Once more, Java "skeleton code" (and I guess the ones for some other languages as well) uses wrong type.
int
is too small to handle all possible values.E.g. for
2997 2998 2999 3000
result is3380890906299
.