longest common prefix (1) 썸네일형 리스트형 LeetCode: 14번 (Longest Common Prefix) [JAVA] 문제 링크 https://leetcode.com/problems/longest-common-prefix/ Longest Common Prefix - 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 풀이 전체적인 풀이 과정은 다음과 같다. 주어진 strs 배열의 첫 번째 요소를 가져온 후 해당 단어가 가진 접두사 모음을 모두 HashSet에 저장 그 이후 요소들을 돌며 현재 HashSet 속 접두사들과 비교를 하며 맞지 않은 접두사들의 경우 HashSet에서 삭제 .. 이전 1 다음