Swap two numbers without a third variable and find second largest
Filed under Dell
The question
Swap two numbers without using a third variable (and optimize using multiple methods) and find the second largest number from a collection of numbers in O(N) time and O(1) space.
No write-up yet. Related questions below have one.
Related Dell questions
Collected from public candidate posts and coding forums. Updated Nov 2026.