LeetCode-Swift icon indicating copy to clipboard operation
LeetCode-Swift copied to clipboard

[LongestPalindromicSubstring] Question

Open aluco100 opened this issue 4 years ago • 0 comments

Hi there,

Can u give a bit explanation of the following lines:

      for i in 0..<arr.count {
            searchPalindrome(arr,i,i,&start,&maxLength)
            searchPalindrome(arr,i,i+1,&start,&maxLength)
        }

and:

      if maxLength < r - l - 1 {
            start = l + 1
            maxLength = r - l - 1
        }

Best Regards

aluco100 avatar Dec 13 '20 22:12 aluco100