p2227
V2EX  ›  算法

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

  •  
  •   p2227 · May 3, 2018 · 2687 views
    This topic created in 2959 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   ·   5546 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 07:13 · PVG 15:13 · LAX 00:13 · JFK 03:13
    ♥ Do have faith in what you're doing.