[Java] Leetcode 14. Longest Common Prefix [String #1]

preview_player
Показать описание
In this video, I'm going to show you how to solve Leetcode 14. Longest Common Prefix which is related to String.

Here’s a quick rundown of what you’re about to learn:

Course Contents
(0:00​) Question Walkthrough
(1:08) Solution Explain
(3:19) Code

In the end, you’ll have a really good understanding on how to solve Leetcode 14. Longest Common Prefix and questions that are similar to String.

Now, if you want to get good at String, please checkout my String playlist.

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

ohhh ok now I understand, instead of doing, strs[I].indexOf(common) != 0, I was doing strs[I].indexOf(common) == -1, but that wouldn't make sure it starts at the beginning and in order for it to be a prefix it has to start at the beginning. good one mate

Rob-J-BJJ
Автор

I have to revise this videos bc I've been lacking

Rob-J-BJJ
Автор

Can you explain the 7th line? I don't get the logic

karnany