Ad
  • Custom User Avatar
  • Custom User Avatar

    I'm not sure if this is what you're describing, but it sounds similar to a problem I had where I was trying to find subsequences when the question is really asking for substrings (it says find the largest sequence, which is a little misleading). For instance, if you have the number 957923992590, this has five 9's, and indeed the largest number that is a subsequence of these digits is 99999. However, the solution actually needs the largest substring (number formed by consecutive digits) from the number, which in this case would be 99259. Hopefully that answers your question.

  • Custom User Avatar

    [Ruby] I did not pass the third test case which gives a number with more than fives of 9. Naturally, the largest 5 digit number is 99999 which is my answer. I am not sure where I did wrong.