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.
I solved this problem without using any sort of tree. I'm doing inverse mapping from the last transform to the first one, where I rasterize inverse transforms in chunks. The key for improving performance is to use a cache for nearby sample points so that we don't have to do a full recursion if the cache is still valid (at some recursion level). The cache point can be saved for each transform, but it is essential that we rasterize from 1 to N in each chunk in order to take full advantage of the cache.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Array and simple queries
You are viewing a single comment's thread. Return to all comments →
I solved this problem without using any sort of tree. I'm doing inverse mapping from the last transform to the first one, where I rasterize inverse transforms in chunks. The key for improving performance is to use a cache for nearby sample points so that we don't have to do a full recursion if the cache is still valid (at some recursion level). The cache point can be saved for each transform, but it is essential that we rasterize from 1 to N in each chunk in order to take full advantage of the cache.