일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
- Algorithm
- DP
- ArrayList
- string
- dfs
- PCCP
- 브루트포스
- 부분배열
- 우선순위 큐
- Java
- coding
- 리트코드
- priority queue
- 깊이우선탐색
- HashMap
- programmers
- 재귀함수
- 알고리즘
- leetcode
- greedy
- hashset
- recursion
- Array
- two pointers
- binary tree
- Today
- Total
목록hashset (5)
지식창고
[Java] LeetCode 2405. Optimal Partition of String 문 제 : String s 가 주어진다. s를 substring으로 나눈다. 나누는 조건은 다음과 같다. - substring 안에서의 각 character들은 유니크 하다. 위와 같은 조건으로 s를 substring으로 나누었을 때, substring의 최소 개수를 구하여라. Constraint { 1
[Java] LeetCode 1319. Number of Operations to Make Network Connected 문 제 : n개의 컴퓨터가 주어진다. 컴퓨터들은 0부터 n-1번의 번호를 가진다. 그리고 connections[i][j] 배열이 주어진다. i번 컴퓨터와 j번 컴퓨터가 연결되었다는 정보를 가진 배열이다. n과 connection[][] 배열이 주어졌을 때, 모든 컴퓨터들을 연결되게 하는 최소 횟수를 구해라. 만약 불가능 하다면, -1을 리턴해라. Constraint { 1
[Java] LeetCode 208. Implement Trie (Prefix Tree) 문 제 : Prefix Tree 클래스를 구현하여라. Constraint { 1
[Java] LeetCode 1061. Lexicographically Smallest Equivalent String 문 제 : 같은 길이의 문자열 s1, s2가 주어진다. s1[i] == s2[i] 조건이 성립한다. 즉, 같은 인덱스의 문자들은 똑같다고 볼 수 있다. 이러한 방식으로 s1, s2에 속한 문자들을 그룹핑 해준다. baseStr의 문자열을 업데이트 해준다. ※ 그 기준은 baseStr 문자열에서 한 문자씩 보며 그룹에 포함이 되어 있는 문자이면 해당 그룹에서 가장 사전순서상의 처음 오는 문자로 대치해준다. You are given two strings of the same length s1 and s2 and a string baseStr. We say s1[i] and s2[i] are..
LeetCode 817. Linked List Components - Java 문제 : Linked List를 주고 그 Linked List의 subset을 준다. 주어진 Linked List를 기준으로 subset List가 순서대로 이어진 그룹이 몇 개인지 센다. Input: head = [0,1,2,3], nums = [0,1,3] Output: 2 Explanation: 0 and 1 are connected, so [0, 1] and [3] are the two connected components. [0, 1] , [3] -> 2 HashSet 생성 HashSet의 특징 : 중복을 허용하지 않는다. Set set = new HashSet(); nums를 HashSet에 추가한다. for(int..