Finding a Hidden Benchmark Value

Samsung coding interview problem: Given arrays A and B (up to 1e5 elements), define SA and SB as the total scores of each array based on a shared benchmark D. Find the value D that yields the maximum difference SA - SB (not absolute). If multiple D produce the same maximum difference, return the smallest D. Classic interview question from Samsung interviews on array scoring.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: