p2227
V2EX  ›  算法

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

  •  
  •   p2227 · May 3, 2018 · 2755 views
    This topic created in 3005 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   ·   1077 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 18:26 · PVG 02:26 · LAX 11:26 · JFK 14:26
    ♥ Do have faith in what you're doing.