-1

We have a list of strings. I given smaller subsquences with atmost three dashes in between the letters I have to find the maximum number of matches it can make.

Eg. 1243, 3452, 2343,124

1_4_

Answer is 2 as 1243 and 124 both matches. We can either fill with any number or leave it.

Can anyone suggest me with some efficient hashing techniques?

ChocoLite
  • 111
  • 5

1 Answers1

0

Hashing wouldn't be a good approach for this problem...I suggest stringifying your numbers and then using a regex to match the characters based on their index in the string.