Partition Labels | LeetCode 763 | C++, Java, Python

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

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

September LeetCoding Challenge | Problem 4 | Partition Labels | 4 September,
Facebook Coding Interview question,
google coding interview question,
leetcode,
Partition Labels,
Partition Labels c++,
Partition Labels Java,
Partition Labels python,
Partition Labels solution,
763. Partition Labels,

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

we can also convert this problem to merge-overlapping intervals problem
Algo -> Traverse the string and find the interval for each character (i.e the starting and ending index)
Now traverse the intervals and merge the overlapping intervals
Store the size of the intervals obtained in previous step and return the answer.

acxd
Автор

You explain very well, thank you! I wish you also explained the Java code while coding, as Java is more popular for coding interviews.

TharaMesseroux
Автор

You have the art of explaining leetcode problems like picasso :)

sugandhm
Автор

Great explanation!

For python I used {letter: S.rindex(letter) for letter in list(set(S))} to have the last index for each letter in the string, instead of having indexes for letters that never appear.

TheGrandPoobahh
Автор

I saw many programming video but your way of solving problems it pretty much good.

AvinashKumar-pstw
Автор

Sir please change the background... I have seen many videos of yours. Every time I thought of commenting this but this time I am pleading you to please choose the background at complete black.
That will make your audience to understand more easily without getting distracted from those white spots.

ankurkumar
Автор

i am just confirming that this is unsolvable using one pass right?

pleasesirmorevideos
welcome to shbcf.ru