Dsa
Hashing
Medium
Access Pattern Fingerprinting
In a security audit, we want to find users who share identical access patterns. A user's access pattern is the set of unique resources they have accessed, regardless of the order or frequency. Given a list of user-resource pairs, find the size of the largest group of users who have accessed the exact same set of resources.
Input Format:
N (number of access logs). Then N lines of 'username resource_id'.
Output Format:
Print the size of the largest group of users with identical resource sets.
Example:
Input:
6
admin server1
admin server2
guest server1
dev server2
dev server1
root server3
Output:
2
(Explanation: 'admin' and 'dev' both accessed {server1, server2}.)
Key concepts
hashingset-hashingidentity
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now