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.
To beat all test cases I had to convert row and column values to base 7 and count all triangles in Sierpinski triangle in every cell. My algorithm has 0(log7)^3 complexity. I had wrong answers due to special case for row or column = 0. So keep in mind this special case.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #148: Exploring Pascal's triangle.
You are viewing a single comment's thread. Return to all comments →
To beat all test cases I had to convert row and column values to base 7 and count all triangles in Sierpinski triangle in every cell. My algorithm has 0(log7)^3 complexity. I had wrong answers due to special case for row or column = 0. So keep in mind this special case.