Skip to content

Incorrect code in string rotation #4

Open
@alexrud-perf

Description

@alexrud-perf

current implementation always returns true, even if s2 contains all different characters: isRotation("abcd", "1234") -> true

it should be:

return isSubstring((s1 + s1), s2);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions