Category: LeetCode Series

May 22, 2023 / LeetCode Series

The Question is from the interview section of leetcode and is marked as easy difficult. Here is the description: The Problem Given a string s containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[‘ and ‘]’, determine if the input string is valid. An input string is valid if: Example 1: Input: s = “()” Output: true Example 2:…

May 3, 2023 / LeetCode Series

The Problem: Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string “”. Example 1: Input: strs = [“flower”,”flow”,”flight”] Output: “fl” The Solution: This is a question from leetcode. Let me show you the solution and…