Qed jitgħabba l-eżerċizzju…
This exercise shows how to compare two strings by small chunks instead of single characters. Write a function string_match that takes strings a and b and counts the positions where both strings have the same two-character substring at the same index. Only check positions where a full two-character slice exists in both strings.
"xxcaazz", "xxbaaz"3"abc", "abc"2"abc", "axc"0def string_match(a: str, b: str) -> int:
Idħol biex tara l-istorja tas-sottomissjonijiet
IdħolIdħol biex tuża l-Mentor tal-AI
Idħol"xxcaazz", "xxbaaz"3"abc", "abc"2"abc", "axc"0"hello", "he"1"", ""0"zzaacxx", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"1