For each item j in list, how to get [k in list]?

I’ve found this thread after some searching, but it doesn’t offer a full solution? Other than the weird creating a function way.