Go Arrays - Program to find the duplicate elements of an Array
Go program to find the duplicate numbers in an Array // Go program to find duplicate numbers in an Array package main import "fmt" // Main function func main() { // Let’s define an array first arr := [10] int { 33 , 2 , 1 , 22 , 2 , 6 , 3 , 1 , 33 , 9 } for i := 0 ; i < len(arr); i++ { for j := i + 1 ; j < len(arr); j++ { if arr[i] == arr[j] { fmt.Println(arr[j]) } } } } Output: Go program to find the duplicate words in an Array // Go program to find duplicate words in an Array package main import "fmt" // Main function func main() { // Let’s define an array first arr := [ 10 ] string { "Go" , "Java" , "Javascript" , "Python" , "Php" , "Kotlin" , "Vue" , "C" , "Go" , "Python" , } for i := 0 ; i < len(arr); i++ { for j := i + 1 ; j