Map2 99클럽 코테 스터디 40일차 TIL Optimal Partition of String https://leetcode.com/problems/optimal-partition-of-string/description/ 비트연산자map 1. 문제 및 접근 2405. Optimal Partition of String 주어진 s의 서브 스트링을 구성하는데, 중복된 char가 없게 만들어야 한다최소의 subString 갯수를 반환"abacaba" 라면 "ab" "ac" ,"aba"로 나눴다면 aba에서 a가 2개라 안됨s = abacaba 라면 앞에서부터 시작해서 있는 수 중 같은 수가 들어오면 그전까지 담기 ?각 substring은 중복되도 되는 듯 하다 Constraints:1 s consists of only English lowercase letters. 2. 풀이 .. 2024. 6. 28. 99클럽 코테 스터디 32일차 TIL Top K Frequent Elements feat. CountingSort https://leetcode.com/problems/top-k-frequent-elements/description/ priorityQueuemapmap.mergecounting sort 1. 문제 및 접근 347. Top K Frequent Elementsmap으로 관리31일차 문제와 너무 유사priorityQueue로 우선순위를 빈도의 내림차순으로 주고 K개만큼 뽑기++counting sort 방식 추가 문제가 이해하기 힘들어서 내 영어 실력의 문제인가 했지만, 댓글들을 보니 전세계인들이 화나있다불친절한 리트코드.. Constraints:1 -10^4 k is in the range [1, the number of unique elements in the array].It is g.. 2024. 6. 20. 이전 1 다음