Intersecting Intervals (Easy)
**This is the easy version of the problem. Here, there are no queries.** Given $2$ arrays $A$ and $B$, both of length $N$, define $f(A, B)$ as follows: - Choose $2$ intervals $[L_1, R_1]$, $[L_2, R_2]$ such that: - $1 \le L_i \le R_i \le N$ - $[L_1, R_1] \cap [L_2, R_2]$ is non-empty, i.e. they share at least one point. - The score of this choice of intervals is defined as $\displaystyl
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