← Isomorphic Strings
Discussions
Sign in to join the discussion.
R
riyachatterjee
OFFICIAL
1 week, 1 day ago
Why does my solution TLE on the last test case?
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.
💬 2 replies
A
aaravsingh
OFFICIAL
1 month, 3 weeks ago
Why does my solution TLE on the last test case?
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.
💬 0 replies
G
gurpreet_42
4 months, 3 weeks ago
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