Загрузка страницы

FACEBOOK - VALID PARENTHESES (LeetCode)

One of Facebook's most commonly asked interview questions according to LeetCode.

Coding Interviews Valid Parentheses (LeetCode) question and explanation.
This interview question is commonly asked by the following companies: Facebook, Bloomberg, Amazon, Google, Microsoft, LinkedIn, and more.

Problem Description: Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.

An input string is valid if:
1. Open brackets must be closed by the same type of brackets.
1. Open brackets must be closed in the correct order.

Note that an empty string is also considered valid.

Example 1:
Input: "()"
Output: true

Example 2:
Input: "()[]{}"
Output: true

Example 3:
Input: "(]"
Output: false

Example 4:
Input: "([)]"
Output: false

Example 5:
Input: "{[]}"
Output: true

Support me on Patreon: https://www.patreon.com/KevinNaughtonJr
Follow me on GitHub: https://github.com/kdn251
Follow me on Instagram: https://www.instagram.com/programeme

Видео FACEBOOK - VALID PARENTHESES (LeetCode) канала Kevin Naughton Jr.
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
7 сентября 2018 г. 6:51:29
00:10:18
Яндекс.Метрика