Remove Pattern Repeatedly

Python Hard 2 views
Back to Questions

Problem Description

Read two strings s and p. 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