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.
But the question says that if two or more grids satisfy the condition for number of rows and columns, then choose the one with min rows(n) x columns(m).
The above code does not take minimum n x m.
Example : chillout
It gives different answers for 2 x 4 and 3 x 3. And 2 x 4 has min n x m.
Testcase giving wroung output
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Encryption
You are viewing a single comment's thread. Return to all comments →
But the question says that if two or more grids satisfy the condition for number of rows and columns, then choose the one with min rows(n) x columns(m).
The above code does not take minimum n x m.
Example : chillout It gives different answers for 2 x 4 and 3 x 3. And 2 x 4 has min n x m.
Testcase giving wroung output