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

Programming Exercises

Implement a program to remove duplicates from an array.

Hard

Problem Statement

Implement a program to remove duplicates from an array.

Sample Input

arr = {1, 2, 3, 2, 4, 1}

Sample Output

Array after removing duplicates: 1 2 3 4 

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
#include <stdio.h> int main() { int arr[] = {1, 2, 3, 2, 4, 1}; int size = sizeof(arr) / sizeof(arr[0]); // Logic to remove duplicates return 0; }
Log in or sign up to run or submit your code.Log inSign up
Input
arr = {1, 2, 3, 2, 4, 1}
Expected Output
Array after removing duplicates: 1 2 3 4