Ad
  • Default User Avatar

    not an issue.

  • Custom User Avatar

    Array basically looks like this, right?

    [1, 2, 3, 4, 5 ]
    [6, 7, 8, 9, 10]
    [11, 12, 13, 14, 15]
    [16, 17, 18, 19, 20]
    [21, 22, 23, 24, 25]

    So you're going:

    right --->
    ^down
    |
    **|
    |********v
    up<-----left

    So you do start at

    --------->
    1,2,3,4,5|
    ********6|
    ********7|
    ********8|
    ********9V
    ********10

    Etc.

    Did my best with formatting lol.

    Ps., in your example, you have 6 in your first array (1-10) and 4 in your second (6-9). 10 belongs at the end of the second array.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    The 2nd hidden test case is "abcdefghba".
    There exists no substring within the string that is a palindrome.
    Therefore the length of the longest substring is any of the letters.
    So the answer is 1. I hope this helps.

  • Default User Avatar

    @kgashok, can you please explain the 2nd hidden test case? I don't see a palindrome :(