Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
给定盒子 A 的 LxWxH 和盒子 B 的 LxWxH,我如何做一个简单的检查以查看 A 是否适合 B(必要时旋转 90 度)?我试图避免检查所有可能的排列。谢谢。
我会检查一下
minimum dimension of A < minimum dimension of B && median dimension of A < median dimension of B && maximum dimension of A < maximum dimension of B
如果满足这 3 个条件,则 A 适合 B。