Розмір відео: 1280 X 720853 X 480640 X 360
Показувати елементи керування програвачем
Автоматичне відтворення
Автоповтор
Elegant and simple + walkthrough for easy understanding code. I enjoy watching your LC videos.
Do videos on system design
🎉🎉🎉❤❤❤😊😊 super. I can understand that code. But one small doubt. We just removing star before character , but * is stay , that how going to be deleted??? 2What is the concept ?
haha so simpleconst str = 'J*ave*d'function removeStarFromStr(str){ if(typeof str !== 'string') return "Invalid Type!!"; let result = [] for(const item of str){ if(item === '*'){ if(result.length > 0){ result.pop() } }else{ result.push(item) } } return result.join("")}console.log(removeStarFromStr(str))
Elegant and simple + walkthrough for easy understanding code.
I enjoy watching your LC videos.
Do videos on system design
🎉🎉🎉❤❤❤😊😊 super. I can understand that code. But one small doubt. We just removing star before character , but * is stay , that how going to be deleted??? 2
What is the concept ?
haha so simple
const str = 'J*ave*d'
function removeStarFromStr(str){
if(typeof str !== 'string') return "Invalid Type!!";
let result = []
for(const item of str){
if(item === '*'){
if(result.length > 0){
result.pop()
}
}else{
result.push(item)
}
}
return result.join("")
}
console.log(removeStarFromStr(str))