同步操作将从 doocs/leetcode 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
A monochrome screen is stored as a single array of int, allowing 32 consecutive pixels to be stored in one int. The screen has width w
, where w
is divisible by 32 (that is, no byte will be split across rows). The height of the screen, of course, can be derived from the length of the array and the width. Implement a function that draws a horizontal line from (x1, y)
to (x2, y)
.
Given the length of the array, the width of the array (in bit), start position x1
(in bit) of the line, end position x2
(in bit) of the line and the row number y
of the line, return the array after drawing.
Example1:
Input: length = 1, w = 32, x1 = 30, x2 = 31, y = 0 Output: [3] Explanation: After drawing a line from (30, 0) to (31, 0), the screen becomes [0b000000000000000000000000000000011].
Example2:
Input: length = 3, w = 96, x1 = 0, x2 = 95, y = 0 Output: [-1, -1, -1]
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。