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.
yes, what you say is correct, BUT, considering the different test cases that might test this , you could get an input of TTTYYYUUUDDDDUUDD where T and Y are not U and D , and those could broke your method, if you doble check for U and D only , you are considering just those two letters, and that is what the problem suggests to check for.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Counting Valleys
You are viewing a single comment's thread. Return to all comments →
yes, what you say is correct, BUT, considering the different test cases that might test this , you could get an input of TTTYYYUUUDDDDUUDD where T and Y are not U and D , and those could broke your method, if you doble check for U and D only , you are considering just those two letters, and that is what the problem suggests to check for.