Размер видео: 1280 X 720853 X 480640 X 360
Показать панель управления
Автовоспроизведение
Автоповтор
Good explanation didi...Stack problem are very important..😊
Done ✅✅
If there is will there is a way
Day-21 ,Task completed✅. Thank you Didi😊
Great job!
Hindi me padhao aap ka channel jyada grow karega👍🏻👍🏻👍🏻
Sahi baat Bhai 🎈
Brute force Approach class Solution{ public boolean isValid(String s) { Stack stack = new Stack(); for (char ch : s.toCharArray()) { if (ch == '(' || ch == '{' || ch == '[') { stack.push(ch); } else if (ch == ')' && !stack.isEmpty() && stack.peek() == '(') { stack.pop(); } else if (ch == '}' && !stack.isEmpty() && stack.peek() == '{') { stack.pop(); } else if (ch == ']' && !stack.isEmpty() && stack.peek() == '[') { stack.pop(); } else { return false; } } return stack.isEmpty(); }}
Good explanation didi...
Stack problem are very important..😊
Done ✅✅
If there is will there is a way
Day-21 ,Task completed✅.
Thank you Didi😊
Great job!
Hindi me padhao aap ka channel jyada grow karega👍🏻👍🏻👍🏻
Sahi baat Bhai 🎈
Brute force Approach
class Solution{
public boolean isValid(String s) {
Stack stack = new Stack();
for (char ch : s.toCharArray()) {
if (ch == '(' || ch == '{' || ch == '[') {
stack.push(ch);
} else if (ch == ')' && !stack.isEmpty() && stack.peek() == '(') {
stack.pop();
} else if (ch == '}' && !stack.isEmpty() && stack.peek() == '{') {
stack.pop();
} else if (ch == ']' && !stack.isEmpty() && stack.peek() == '[') {
stack.pop();
} else {
return false;
}
}
return stack.isEmpty();
}
}