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

Programming Exercises

Write a TypeScript program to merge two arrays and remove duplicate values.

Easy

Problem Statement

Write a TypeScript program to merge two arrays and remove duplicate values.

Sample Input

Array 1: [1, 2, 3], Array 2: [2, 3, 4, 5]

Sample Output

Merged Array: [ 1, 2, 3, 4, 5 ]

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
let array1: number[]; let array2: number[]; function mergeAndRemoveDuplicates(arr1: number[], arr2: number[]): number[] { // Your logic here } // Call the function
Log in or sign up to run or submit your code.Log inSign up
Input
Array 1: [1, 2, 3], Array 2: [2, 3, 4, 5]
Expected Output
Merged Array: [ 1, 2, 3, 4, 5 ]