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 for the // in ans += (i[1] * (i[1] + 1)) // 2 as i[1] will always be greater than 1 and hence i[1]+1 will be even when i[1] is odd and vice-versa. So this formula yeilds only integer results.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Special String Again
You are viewing a single comment's thread. Return to all comments →
No Need for the // in ans += (i[1] * (i[1] + 1)) // 2 as i[1] will always be greater than 1 and hence i[1]+1 will be even when i[1] is odd and vice-versa. So this formula yeilds only integer results.