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.
You can't get better than O(n^2), the goal is to print an nxn matrix where some of the elements are spaces and some are #. In order to do that you have to do at least the n^2 print statements.
Just because you can code it in a few lines in a language like C# doesn't mean it's more efficient, that same process is going on behind the scenes.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Staircase
You are viewing a single comment's thread. Return to all comments →
You can't get better than O(n^2), the goal is to print an nxn matrix where some of the elements are spaces and some are #. In order to do that you have to do at least the n^2 print statements.
Just because you can code it in a few lines in a language like C# doesn't mean it's more efficient, that same process is going on behind the scenes.