Longest common prefix | Brute force - Optimal |Solution explained (java)

preview_player
Показать описание
Recommend listening at 1.5X speed.
#longestcommonprefix #leetcodequestions #stringsinjava #codinginterviewquestions

Problem statement:
Write a function to find the longest common prefix string amongst an array of strings.
If there is no common prefix, return an empty string "".

Example 1:

Input: strs = ["flower","flow","flight"]
Output: "fl"
Example 2:

Input: strs = ["dog","racecar","car"]
Output: ""
Explanation: There is no common prefix among the input strings.

Practice link:
Рекомендации по теме
Комментарии
Автор

i really like your way delivering solution step by step . It helped me so much. Thankyou and keep making vedios .

pallavikumari
Автор

Please increase loudness of your voice and everything else is perfect.

pallavikumari