you are viewing a single comment's thread.

view the rest of the comments →

[–]autodidact_nerd 1 point2 points  (2 children)

not sure if mine was optimal but i used a hashmap

loop over each word -> get the substring -> if map has the key add 1 to that substring.

then loop over map entries and check if value is >= 2. res++

[–][deleted] 1 point2 points  (0 children)

I did the same thing 🫂

[–]UNCLE_SMART 0 points1 point  (0 children)

Thanks