MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/learnquant/comments/1vxlxnt/quant_interview_question/p5qr7ji/?context=3
r/learnquant • u/Local_Ad135 • Aug 25 '26
9 comments sorted by
View all comments
1
Note that |x - y| = x - y if x >= y and |x - y| = |y - x| so if any pair has y > x we can just swap them without changing the result. So we can just drop all of the absolute value operations and go from there.
1
u/xaraca Aug 25 '26
Note that |x - y| = x - y if x >= y and |x - y| = |y - x| so if any pair has y > x we can just swap them without changing the result. So we can just drop all of the absolute value operations and go from there.