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

Programming Exercises

Write a Go program to find duplicate elements in a slice of integers.

Medium

Problem Statement

Write a Go program to find duplicate elements in a slice of integers.

Sample Input

A slice of integers (e.g., [1, 2, 3, 2, 4, 3, 5]).

Sample Output

Duplicates: [2 3]

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
package main import "fmt" func main() { // Find and print duplicate elements in a slice }
Log in or sign up to run or submit your code.Log inSign up
Input
A slice of integers (e.g., [1, 2, 3, 2, 4, 3, 5]).
Expected Output
Duplicates: [2 3]