Gold Chain Split
Asked at Google
Reported by the problem's creator, not verified
A gold chain is a row of links, and weights[i] is the weight of link i. Link indices are 0-based. GoldChain(weights) holds the chain.
python from typing import List
class GoldChain: def __init__(self, weights: List[int]) -> None: pass
def can_split(self) -> bool: raise NotImplementedError
Examples
Example 1
Input: init =
[[1,2,3,4]], operations =[["can_split",[]]]Output:
[true]Explanation: Removing the link of weight 2 (index 1) leaves 1, 3, 4. Cutting after the first two links gives pieces of weight 4 and 4.
Import your own questions
Paste a question you were asked and get a full problem: statement, tests and a checked solution.