Optimize The Slow Code
CodeChefOpen on judge ↗
Chef hates unoptimized codes and people who write such codes. One fine day he decided to look through the kitchen's codebase and found a function whose pseudo-code is given here: ```plaintext input: integer N, list X[1, 2, ..., N], list Y[1, 2, ..., N] output: integer res function: set res = 0; for i := 1 to N do for j := 1 to N do for k := 1 to N do if (X[i] = X[j]) OR (X[j]
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