同步操作将从 doocs/leetcode 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
Given two squares on a two-dimensional plane, find a line that would cut these two squares in half. Assume that the top and the bottom sides of the square run parallel to the x-axis.
Each square consists of three values, the coordinate of bottom left corner [X,Y] = [square[0],square[1]]
, and the side length of the square square[2]
. The line will intersect to the two squares in four points. Return the coordinates of two intersection points [X1,Y1]
and [X2,Y2]
that the forming segment covers the other two intersection points in format of {X1,Y1,X2,Y2}
. If X1 != X2
, there should be X1 < X2
, otherwise there should be Y1 <= Y2
.
If there are more than one line that can cut these two squares in half, return the one that has biggest slope (slope of a line parallel to the y-axis is considered as infinity).
Example:
Input: square1 = {-1, -1, 2} square2 = {0, -1, 2} Output: {-1,0,2,0} Explanation: y = 0 is the line that can cut these two squares in half.
Note:
square.length == 3
square[2] > 0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。