IsaacYoung
V2EX  ›  算法

leetcode 俄罗斯套娃问题

  •  
  •   IsaacYoung · May 26, 2022 · 1428 views
    This topic created in 1458 days ago, the information mentioned may be changed or developed.

    https://leetcode.com/problems/russian-doll-envelopes/

    二维的情况下 通过 x 升序 y 降序排序,降低一个维度后使用 LIS 算法即可

    如果升级到 3 维甚至 N 维呢?

    1 replies    2022-05-26 19:11:28 +08:00
    thedrwu
        1
    thedrwu  
       May 26, 2022 via Android
    粗略看了一眼。按照 max(w,h,z)排列,然后 O(n²)找回去
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2996 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 52ms · UTC 08:55 · PVG 16:55 · LAX 01:55 · JFK 04:55
    ♥ Do have faith in what you're doing.