Check if loop has any categories?

Hello,
In my loop, I have ten posts with the following categories (slug): group-a, group-a-first and group-b. What's the best way to check if those ten posts has any category?

I've tried 'if(in_category('group-a'))', it does work but it checks every post so I get ten results: yes, yes, yes, no, yes, yes, no, etc.

What I'm looking for if any post has a category, it's a yes or no.

Thanks,