austinschwartz/ctci_v6

Incomplete test cases for ch1/StringRotation.java

pandeesh opened this issue · 3 comments

I believe your code would fail for the below test case:

https://github.com/pandeesh/ctci_v6/blob/master/ch01/1.09_-_String_Rotation/StringRotation.java

isRotation("pandeesh", "deeshpand")

second arg is not a valid rotation because of the last letter "d". Or if it's a valid rotation, then please add some comments in your code about the criteria.

Thanks

Ah, thats true. I suppose the easiest way of fixing this would be to check the lengths of s1 and s2 and make sure they're equal.

Yes that's right. You beat me in sending pull requests :) thanks for using my name in the example :)

Sent from my iPhone

On Oct 4, 2015, at 5:06 PM, Austin notifications@github.com wrote:

Ah, thats true. I suppose the easiest way of fixing this would be to check the lengths of s1 and s2 and make sure they're equal.


Reply to this email directly or view it on GitHub.

Thanks for bringing up the issue!