← Discussions on Isomorphic Strings
G gurpreet_42
27 May 2026, 15:19

Intuition + complexity breakdown for Isomorphic Strings.

Use a hash map from value to index (or count). For each element check whether its complement is already in the map, then insert it. That makes it O(n) instead of the O(n²) brute force.

1 reply

sanjaygho1 4 months, 2 weeks ago

Watch out for integer overflow in Java on the large test.

Sign in to reply.