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.
My program works but experts as usual came with refinements. Following two points can speed up the program by 40%:
1) Matrix need not be created explicitly.
2) Two kinds of rotations give identical results.
After doing these improvements, Python3 program runs within 4 sec for the worst case on i7.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Hackonacci Matrix Rotations
You are viewing a single comment's thread. Return to all comments →
My program works but experts as usual came with refinements. Following two points can speed up the program by 40%: 1) Matrix need not be created explicitly. 2) Two kinds of rotations give identical results. After doing these improvements, Python3 program runs within 4 sec for the worst case on i7.