30-Days-DSA-Challenge icon indicating copy to clipboard operation
30-Days-DSA-Challenge copied to clipboard

2116. Check if a Parentheses String Can Be Valid

Open RAJKUMAR1301 opened this issue 1 year ago • 4 comments

Description

  1. Check if a Parentheses String Can Be Valid

DSA Problem

A parentheses string is a non-empty string consisting only of '(' and ')'. It is valid if any of the following conditions is true:

It is (). It can be written as AB (A concatenated with B), where A and B are valid parentheses strings. It can be written as (A), where A is a valid parentheses string. You are given a parentheses string s and a string locked, both of length n. locked is a binary string consisting only of '0's and '1's. For each index i of locked,

If locked[i] is '1', you cannot change s[i]. But if locked[i] is '0', you can change s[i] to either '(' or ')'. Return true if you can make s a valid parentheses string. Otherwise, return false.

RAJKUMAR1301 avatar Oct 06 '23 09:10 RAJKUMAR1301

@iamdestinychild Kindly assign me!

RAJKUMAR1301 avatar Oct 06 '23 09:10 RAJKUMAR1301

@RAJKUMAR1301 I will add a solution in golang.!

nikzayn avatar Oct 08 '23 06:10 nikzayn

@nikzayn create an issue that you want to add a solution in Golang so I can assign it to you, please read the contribution.md

iamdestinychild avatar Oct 08 '23 12:10 iamdestinychild

@nikzayn Sir , can you assign me this issue

ujjwalshivhare avatar Oct 09 '23 23:10 ujjwalshivhare