soapyigu/LeetCode-Swift

[LongestPalindromicSubstring] Question

aluco100 opened this issue · 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