Skip to content

Instantly share code, notes, and snippets.

@thmain
Created October 28, 2023 23:06
Show Gist options
  • Save thmain/239cd19b18e6ce6aa5ab18515d03eded to your computer and use it in GitHub Desktop.
Save thmain/239cd19b18e6ce6aa5ab18515d03eded to your computer and use it in GitHub Desktop.
package main
import "fmt"
func findTwoRepeating(A []int) {
fmt.Print("Repeated Elements: ")
for i := 0; i < len(A); i++ {
for j := i + 1; j < len(A); j++ {
if A[i] == A[j] {
fmt.Print(A[i], " ")
}
}
}
fmt.Println()
}
func main() {
A := []int{1, 5, 2, 4, 8, 9, 3, 1, 4, 0}
findTwoRepeating(A)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment