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.
- Grid Challenge
- Discussions
Grid Challenge
Grid Challenge
Sort by
recency
|
474 Discussions
|
Please Login in order to post a comment
Python
Even better option: 1.3x faster
Python
"Sample Test Case 1" has an input that does NOT match the constraints in the problem description.
Specifically: There will be N strings each of which will be of length N. This implies the grid is always square.
The aformentioned test case contains the following input: 4 abc hjk mpq rtv
4 strings, each with 3 characters.
Please either correct your test case or the problem description.
(also please fix these text boxes which are not expanable nor scrollable past 10 lines on the latest firefox version as of today (been like this for as long as I've been using HR the last few months AFAIK). I have no choice but to type in something else, then paste.)
My Java 8 Solution
No clever way of solving this; You have to iterate through the list, convert each string into a char array, sort them, create a new sorted gridand than iterate through the new grid with a nested for loop, and and check if the vertical lines are in order.