Verify Alien Dictionary | Leetcode 953 | Arrays

preview_player
Показать описание
Topic: Arrays
Time Complexity: O(n)
Code:

Leetcode:

*Note* I claim no rights to this question. All rights belong to Leetcode. If I'm reviewing a solution that was from another Leetcode user or Leetcode itself I will give credit below.

Credit to :

Hey there! Just wanted to let you know that some of the below links in this video description are affiliate links, which means that if you make a purchase through them, I may earn a small commission. Don't worry though, it doesn't cost you anything extra and it helps support this channel so I can continue to make more videos for you. Thank you so much for your support, and as always, all opinions are my own!

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

Very nice explanation Nidesh. Couple of feedback
a) Always provide the runtime complexity. I believe your algorithm is O(m*n) where m is the average length of string in the array and n is the length of the array. Array building is O(constant) which is O(1)
b) Think your code can be cleaner if you use if/else and make your code a bit more concise. For e.g. at 11:11, you could just have said `return a.length() <= b.length()`. At 9:22, you could just say there was no need for the same flag. You could just handle the scenario al != bl) {}. The continue was just redundant in the loop.


These are very minor things but the important thing is your explanation was concise and crystal clear. Thanks for your time.

raovenu
Автор

I love you Nids!!! Always so helpful 😍

JannibalForKing
Автор

You have some clear explanations across your videos.

abhishekabraham
Автор

plz make more leetcode videos if you get time!!

Ash-foqs
Автор

I don't understand why u do w-'a', could you provide why?

Latidoz_music
Автор

Hey there! Just wanted to let you know that some of the links in this comment are affiliate links, which means that if you make a purchase through them, I may earn a small commission. Don't worry though, it doesn't cost you anything extra and it helps support this channel so I can continue to make more videos for you. Thank you so much for your support, and as always, all opinions are my own!

NideeshTerapalli
Автор

Great style of teaching. Please solve Google interview questions

kanishkbharti
visit shbcf.ru