โ† Walmart questions
CodingReported in a candidate post, Aug 2020

Swap numbers function with specific mapping

Filed under Walmart

Write a function that swaps two specific fixed numbers, such that passing 2 returns 3 and passing 3 returns 2. For any other input, return the input unchanged.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Walmart questions

Collected from public candidate posts and coding forums. Updated Nov 2026.