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.
just return this with long long types
10*((r-1)/2)+(r+1)%2+2*(c-1)
the (r-1)/2 part will give integer so it works fine as long as you change all int types to long or to long long
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Strange Grid Again
You are viewing a single comment's thread. Return to all comments →
just return this with long long types 10*((r-1)/2)+(r+1)%2+2*(c-1) the (r-1)/2 part will give integer so it works fine as long as you change all int types to long or to long long