Given a string s, pattern p. The pattern should appear in string exactly k times. Find the minimum elements to delete from the string s to make it happen.
Constraints:
K <= 10
p.length() <= 10
s.length() <= 5000
solution.cpp
Loading...
Run code to see test results
00:00 / 69:42
Minimum Deletions to Make Pattern Appear K Times
MediumMed•293 views
Problem
Given a string s, pattern p. The pattern should appear in string exactly k times. Find the minimum elements to delete from the string s to make it happen.