Chef and Isomorphic Array
Today, Chef came up with the following problem: Consider two arrays a and b with the same size. Denote the multisets of all elements of arrays a and b by MA and MB respectively. The arrays a, b are isomorphic if it's possible to find a bijective function f: Z → Z which satisfies the following rules: - Let's construct a new multiset MF. For each element x of MA, we should insert f(x) into MF.
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start