코딩테스트/LeetCode
2022. 7. 28.
[LeetCode] Valid Anagram
문제링크 Valid Anagram - 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 두 문자열이 anagram인지 판별하는 문제이다. * anagram : 한 문자열의 단어를 모두 사용해서 다른 문자열을 만드는 놀이 접근 방법 두 문자열을 배열로 변환하고 정렬한 뒤, 문자열로 변환하여 같은지 구하였다. ※ 배열은 참조형 데이터 구조이기 때문에 내용이 같아도 주소가 달라 그대로 비교 연산자를 사용할 수 없다. 배열을 문자열로 변환하는 방법 1. JSON.strin..