Longest Palindromic Substring - Leetcode 5 - Java

preview_player
Показать описание
Longest Palindromic Substring - Leetcode 5 - Java

--------------------------------ABOUT--------------------------------
🧑🏻 My name is David and I am a software engineer at Meta. My passion is teaching software devs how to pass the grueling technical interviews to help them land their 6-figure dream tech job.

I have received 3 six-figure offers from Google, Meta, and Amazon.

🔬I provide content that will allow you to understand the thought process, pseudocode, time complexity, and code when approaching coding problems.

--------------------------------SOCIAL--------------------------------

💬 If you have any topic or questions you want me to cover, let me know in the comment section below ~ ฅʕ•ᴥ•`ʔ ฅʕ•ᴥ•`ʔ ฅʕ•ᴥ•`ʔ

#technicalinterview #techcareer #softwareengineer
Рекомендации по теме
Комментарии
Автор

I was looking for a recursive solution as this is a DP question. Anyways thanks for such great explanation

manishjha
Автор

Could you explain the logic behind computing the startIndex if (length > maxLength)?

caleblevi
Автор

why do you divide the length by 2 while setting it to start

you
Автор

Cool solution but just one thing : why don't you start from max length sub-string instead of min-length sub-string
Above solution will always give fixed time complexity : O(n^2)

amoljadhav