HacktoberFestContribute icon indicating copy to clipboard operation
HacktoberFestContribute copied to clipboard

Contributed kSimilarStrings program in java .. Addition to String folder

Open nath9777 opened this issue 4 years ago • 0 comments

Description of kSimilarStrings:

Strings A and B are K-similar (for some non-negative integer K) if we can swap the positions of two letters in A exactly K times so that the resulting string equals B.

Given two anagrams A and B, return the smallest K for which A and B are K-similar.

eg. Input: A = "ab", B = "ba" Output: 1

nath9777 avatar Oct 12 '20 13:10 nath9777