Implement Edit Distance with transposition