Remove Pattern Repeatedly

Programming Interview Hard 6 views
Back to Questions

Problem Description

Input provides {x}. Remove every occurrence of p from s while scanning left to right (like stack remove). Output final string.

Input Format

Two lines: s then p.

Output Format

One line result.

Sample Test Case

Input:
daabcbaabcbc abc
Output:
dab

Constraints

Total length

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next