[ 題目看嘸 ] LeetCode 1640. Check Array Formation Through Concatenation #104
Answered
by
twy30
LPenny-github
asked this question in
Q&A
-
|
原 issue: LeetCode: 題目看不懂。麻煩各位大大 orz 感激不盡 已知部分: 引用 LeetCode: 我不知道該用什麼格式和標題, @twy30 大大可以自行修改本篇 😉 |
Beta Was this translation helpful? Give feedback.
Answered by
twy30
Dec 18, 2020
Replies: 1 comment 1 reply
-
是的。 題目的要求是:「如果那些片段 ( 可以把這想成「拼圖」。 以 LeetCode 原題的 "Example 4" 來說:
以 LeetCode 原題的 "Example 3" 來說:
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
LPenny-github
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@LPenny-github
是的。
題目的要求是:「如果那些片段 (
pieces) 可以以某種次序連起來組成arr,就傳回true;否則,傳回false。」可以把這想成「拼圖」。
以 LeetCode 原題的 "Example 4" 來說:
pieces有 3 塊:[78],[4,64],[91]arr是[91,4,64,78]true[91],[4,64],[78]的方式將pieces組成arr的樣子以 LeetCode 原題的 "Example 3" 來說:
pieces有 1 塊:[16,18,49]arr是[49,18,16]falsepieces給我們唯一的片段是[16,18,49], 怎麼樣也無法組成arr的樣子[16,18,49]變成[49,18,16]pieces) 的順序,也就是將[78], [4,64], [91]變成[91], [4,64], [78], 但我們沒有去變動「…