Word Pattern | LeetCode 290 | C++, Java, Python

preview_player
Показать описание

**** Best Books For Data Structures & Algorithms for Interviews:**********
*****************************************************************************

September LeetCoding Challenge | Problem 7 | Word Pattern | 7 September,
Facebook Coding Interview question,
google coding interview question,
leetcode,
Word Pattern,
Word Pattern c++,
Word Pattern Java,
Word Pattern python,
Word Pattern solution,
290. Word Pattern,

#CodingInterview #LeetCode #Google #Amazon #WordPattern
Рекомендации по теме
Комментарии
Автор

It's still impressive how you can switch between the three languages!! Thanks.

jimwoodward
Автор

your way of simplification the ideas of problem really helps and motivates me to complete in this the track of competitive programming thank you very much
Hopefully you keep going this series of nice videos

moayyadarz
Автор

Hi sir,
What is the screen recording software that you use?

koteshmeesala
Автор

Sir, only one hash map isn't enough ?
1.run characters (abba) from the beginning
2.if character is new add it to hash map
3. If character already present in map (then check its mapping, if not equal to our string, return false)
4.else return true
Will this work sir ?

panman
Автор

Sir, In C++ Code, can we use map instead of unordered map? Will it be a problem?

shiladityabose
Автор

Instead of using another map for storing char, string you could've used vector<string> v(26) . This reduces overall space complexity.

JardaniJovonovich
Автор

what will happen if the length of the pattern is more than the length of str??

shantanurastogi
Автор

Python has inbuilt string function i.e. "str", I'm afraid the third argument used here is apt, and thereby in the solution. Nevertheless, thankful for simplest explanation! Kudos!

rashminagpal
Автор

Sir can you also do word pattern 2, it's harder and also a premium one or just discuss the approach/method for the same, only difference is there is no space between given pattern.
Thanks for your efforts.

YashTrivedi