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.
I have solved this using my code, which is using a Tree to find an ultra fast and efficient solution, based on pattern matching of an tree based algorithm, something that is industry proven and a standard to be fast and efficient to solving pattern matching problems.
I have seen all the codes in comments, manipulating main methods to get your answer. By avoiding the reading time of inputs into string arrays, saves you time, but that time saved isn't actually meant to be saved, that isn't the way these challenges are supposed to be answered. You are asked to implement it in a method after receiving the input arrays in the method code. YOU MUST IMPLEMENT IT IN THE METHOD. Otherwise your answers are just useless.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Sparse Arrays
You are viewing a single comment's thread. Return to all comments →
I have solved this using my code, which is using a Tree to find an ultra fast and efficient solution, based on pattern matching of an tree based algorithm, something that is industry proven and a standard to be fast and efficient to solving pattern matching problems.
I have seen all the codes in comments, manipulating main methods to get your answer. By avoiding the reading time of inputs into string arrays, saves you time, but that time saved isn't actually meant to be saved, that isn't the way these challenges are supposed to be answered. You are asked to implement it in a method after receiving the input arrays in the method code. YOU MUST IMPLEMENT IT IN THE METHOD. Otherwise your answers are just useless.