Question: Two strings are k-bonded if they share at least k common characters. Each character can contribute at most one bond. For instance, aabbccddXYZABeeffGg and Gfeeexyzab
Two strings are k-bonded if they share at least k common characters. Each character can contribute at most one bond. For instance, “aabbccddXYZABeeffGg” and “Gfeeexyzab” are 1-, 2-, 3-, 4-, 5- and 6-bonded. Define function IsBonded(k, s1, s2), returning true iff s1 and s2 are k-bonded.
Step by Step Solution
★★★★★
3.50 Rating (153 Votes )
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
To solve this problem you need to define a function IsBondedk s1 s2 that checks whether two strings s1 and s2 are kbonded meaning they share at least ... View full answer
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
