Leetcode Valid Parentheses in C# - Solution

preview_player
Показать описание
Hi everyone,
today I show you my solution for the Leetcode problem "Valid Parentheses" in C#. We are using a stack as the data structure.
Have a nice day! :)

➤ Timestamps:
0:00 Introduction
0:15 Problem description
1:00 Solution in Gimp
2:38 Solution in Code

Рекомендации по теме
Комментарии
Автор

Hi everyone! I cut off the code at the very end. :D Here it is:
if(stack.Count!=0){
return false;
}

return true;

Lumary
Автор

very nice, thanks i was trying to solve this!!!

pirufihho
Автор

Interesting problem and great solution, it works👍This is a useful problem and there can be variations like- it can be used as a checkers for valid HTML and XML. Also I would have used switch-case conditions in place of the outer if else conditions.

eric
visit shbcf.ru