Encode and Decode Strings - Leetcode 271

preview_player
Показать описание
#coding #leetcode #python #javascript #programming In this video solve Leetcode 271 - Encode and Decode Strings
Рекомендации по теме
Комментарии
Автор

Check out *dacodejay.com* for free coding interview prep resources! 🚀

DaCodeJay
Автор

What if there is already a n# at precisely the right spot in one of the words? (EDIT: I forgot the consider that knowing the length of substring means that we can completely skip all intermediate characters and will automatically end up at the next true n# combination. Thanks for all the head's ups!)

BjornHeijligers
Автор

or you can put a backslash behind any characters that are the delimiter in the actual string

nikitalurye
Автор

why not use hashmap? position and length for each sub string will enough

hamdimohamed
Автор

Great video man
One question i had. Can we keep and count and store that in an array or something. Then for respliting we iterate the array and split based on the number stored!
Although it will take n space considering n number of elements in original array!

sanketdatta
Автор

When the null-termination became too old-fashioned?

froller
Автор

Now what if you have "4#" as part 9f that string?

bertramstier
Автор

Just use escape sequences damn it (\n or sth like that)

vulnoryx
Автор

Why not just use character count alone?

plutonianfairy
Автор

What if there is a number before the dash in one of the strings?
Dont think you know how all this works

IoDavide
Автор

Just use control/invisible characters like Null char

RomanianProductions
Автор

What if the value contains like this - [2#GO, ...] 😢

MrSiD
Автор

or have each string be null terminated

mrscsi
Автор

The delimiters are a waste of memory of you're already specifying the length. Only the first number needs any non numeric character

ivans