Grokking the Coding Interview: Patterns for Coding Questions
Ask Author
Back to course home

0% completed

Vote For New Content
BROKEN TEST Your Input"catfoxscat" ["cat", "foxs"] Output[] Expected[] when it should be Expected[0,3]

sean.maginnis.sm

Jan 25, 2025

Your Input"catfoxscat" ["cat", "foxs"] Output[] Expected[]

This was marked as correct however......

you can get "catfoxs" & "foxscat"

so the the correct result is [0,3]

the solution uses words[0].length();

This means that if you ever have words of different lengths then the test fails.

1

0

Comments
Comments
S
sean.maginnis.sm 9 months ago

It is given that all words are of the same length. nvm ....

On this page