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.
Some of the test cases have CR+LF (i.e. "\r\n") line endings, and the JavaScript boilerplate solution does not properly strip these off; it assumes all lines end with "\n" only.
That means some of the grids and patterns for the test cases will be arrays like grid=["123\r","456\r","789\r"] and pattern = ["12\r","45\r"].
The boilerplate needs to update its processing of stdin to split on "\n" and then strip "\r" from each line as well.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
The Grid Search
You are viewing a single comment's thread. Return to all comments →
Some of the test cases have CR+LF (i.e. "\r\n") line endings, and the JavaScript boilerplate solution does not properly strip these off; it assumes all lines end with "\n" only. That means some of the grids and patterns for the test cases will be arrays like grid=["123\r","456\r","789\r"] and pattern = ["12\r","45\r"]. The boilerplate needs to update its processing of stdin to split on "\n" and then strip "\r" from each line as well.