Graph problem is tough for me to figure out. I spent 10 minutes to think about, but I could not figure out how to convert it to a graph problem.
Here is the post I read on Leetcode.com about this algorithm, which is one of onsite algorithms in Amazon, Seattle.
- Write a program that given two anagram strings, returns the minimum number of swaps to turn one to the other. Similar to https://www.geeksforgeeks.org/minimum-swaps-to-make-two-array-identical/
No comments:
Post a Comment