Coding
코딩 인터뷰 퀘스천 완전 분석 - Ransome Note
Daily Coding
2020. 11. 8. 15:44
[LeetCode] [Easy] 383. Ransome Note
leetcode.com/problems/ransom-note/
Ransom Note - LeetCode
Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
leetcode.com
Ransome Note
잡지에서 나온 글자를 이용해서 노트를 만드는 문제에요. 잡지니까 한글자에 한번씩만 사용할 수 있겠네요.
HashMap을 사용해서 갯수를 구하고 그 갯수를 비교하는 방법으로 풀었어요.
역시나 느립니다ㅠㅠ
알파벳 사이즈가 26인걸 이용해서 갯수를 저장해두었네요. 예전에도 이 방법을 사용했는데 금방 까먹어버리네요 참.