题解 | 字符串操作
字符串操作
https://www.nowcoder.com/practice/06a5336b64e3481fbbcc1f7d5cba548d
n, m = map(int, input().split())
s = input()
for _ in range(m):
a, b, c, d = input().split()
a, b = int(a), int(b)
s_list = list(s)
for i in range(a-1, b):
if s_list[i] == c:
s_list[i] = d
s = "".join(s_list)
print(s)
