dictionary
-
[리트코드] 0713공부기록/문제풀이 2021. 7. 13. 16:17
https://leetcode.com/explore/challenge/card/july-leetcoding-challenge-2021/609/week-2-july-8th-july-14th/3811/ 문제를 보고, dictionary 구조를 쓰면 빨리 풀 수 있을 것 같았다. 그런데 c++로 하는지라 dictionary구조가 있었나? 해서 고민하다가 결국 솔루션을 찾아봤더니 dictionary를 사용하더라. c++에 unordered_map이 비슷하게 동작한다고 해서 그걸 사용해서 풀었다. class Solution { public: bool isIsomorphic(string s, string t) { unordered_map sm; unordered_map tm; int n = s.size(); for..