Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Write a program to find the symmetric difference between two arrays (elements unique to each array).

Medium

Problem Statement

Write a program to find the symmetric difference between two arrays (elements unique to each array).

Sample Input

[1, 2, 3], [2, 3, 4]

Sample Output

[ 1, 4 ]

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
// Find the symmetric difference between two arrays function symmetricDifference(arr1, arr2) { } console.log(symmetricDifference([1, 2, 3], [2, 3, 4]));
Log in or sign up to run or submit your code.Log inSign up
Input
[1, 2, 3], [2, 3, 4]
Expected Output
[ 1, 4 ]