Skip to content
This repository was archived by the owner on Jan 20, 2024. It is now read-only.

[CONTENT] Solve this problem and write out a solution for it. (or make a video) #277

@ykdojo

Description

@ykdojo

Description

One of the approved questions we have was recently asked by Google, and it is this:

You need to check whether the string is well nested or not based on two conditions:

  1. If they are, return the string as-is.
  2. If they are not, repair the string so that the parentheses are well nested and return the result.

You can perform three actions to validate the string. Three actions are: Delete, Add, Update.

You must convert it a well-nested string with the minimum number of actions.

Test Examples:
Input: (()
Output: (()), or () or ()()

Input: (())))
Output: ((()))

It'll be good to have a solution for this so we can display it on the website, and so we can make a video out of it.

Metadata

Metadata

Type

No type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions