p2227
V2EX  ›  算法

关于字符串的算法题,题目很简单,但我想看看网上有没有更好的解法时,不知道用什么关键字去搜索

  •  
  •   p2227 · May 3, 2018 · 2717 views
    This topic created in 2980 days ago, the information mentioned may be changed or developed.
    有两个字符串,s1,s2,长度和构成的字符都一样,但顺序不一样,求最少的交换把 s1 变成 s2

    我搜索了一下 Damerau-Levenshtein 距离 只交换相邻的,现在不限于相邻。
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   951 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 19:53 · PVG 03:53 · LAX 12:53 · JFK 15:53
    ♥ Do have faith in what you're doing.