i having the following code to print the indexes of an array which contains similar values.
but on running this code getting panic: indexes out of range run time error
why i am getting this
package main
import "fmt"
func main() {
var numbers[] int = [] int {5,2,3,5,3}
var copy_numbers[] int
var count [5] int
var i,j int
copy(copy_numbers,numbers)
for i=0;i<len(numbers);i++ {
for j=0;j<len(numbers) ;j++ {
if numbers[i]==numbers[j] {
count[i]++;
}
}
}
fmt.Printf("%d",count)
for i=0;i<len(numbers) ;i++ {
fmt.Println("hello")
if count[i]>1{
for j=0;j<len(numbers) ;j++ {
if numbers[i]==copy_numbers[j] {
fmt.Printf("%d",j)
}
}
fmt.Println("")
}
}
fmt.Printf("%d",count)
}