Skip to content

Instantly share code, notes, and snippets.

View hye-ung97's full-sized avatar
๐Ÿค“

์„ฑํ˜œ์˜ hye-ung97

๐Ÿค“
View GitHub Profile
public class Coin {
public static int solution(int sum, int[] coins){
int[] dp = new int[sum + 1];
dp[0] = 1;
for (int i = 0; i < coins.length; i++) {
for (int j = 1; j <= sum; j++) {
if (j >= coins[i])
dp[j] += dp[j - coins[i]];
}
}
import java.util.*;
class Solution
{
public int solution(int [][]board)
{
int answer = 0;
answer = Arrays.stream(board).flatMapToInt(Arrays::stream).max().getAsInt();
if(answer == 0){
return 0;
class Solution {
public static int[] answer;
public int[] solution(int[][] arr) {
answer = new int[2];
divide(arr, 0, 0, arr.length);
return answer;
}
public static void divide(int[][] arr, int a, int b, int size){
@hye-ung97
hye-ung97 / keypad.java
Created June 30, 2023 06:56
ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค - ๋Œ€์ถฉ๋งŒ๋“ ์žํŒ
import java.util.*;
class Solution {
public int[] solution(String[] keymap, String[] targets) {
int[] answer = new int[targets.length];
HashMap<Character, Integer> keypad = new HashMap<>();
for (int i = 0; i < keymap.length; i++) {
for (int j = 0; j < keymap[i].length(); j++) {
char cur = keymap[i].charAt(j);
class Solution {
public int solution(String skill, String[] skill_trees) {
int answer = 0;
for (int i = 0; i < skill_trees.length; i++) {
skill_trees[i] = skill_trees[i].replaceAll("[^"+skill+"]","");
boolean flag = false;
for (int j = 0; j < skill_trees[i].length(); j++) {
if(skill.charAt(j) != skill_trees[i].charAt(j)){
flag = true;
@hye-ung97
hye-ung97 / bestAllbem.java
Created June 15, 2023 05:18
ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค - ๋ฒ ์ŠคํŠธ์•จ๋ฒ”
import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
public class Solution {
public static class movie{
int idx;
int play;
import java.util.*;
class Solution {
boolean solution(String s) {
boolean answer = true;
Stack<Character> stack = new Stack<>();
for(char item : s.toCharArray()){
if(item == '('){
stack.push('(');
}
@hye-ung97
hye-ung97 / slim.java
Created June 13, 2023 06:58
ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค - ์••์ถ•
import java.util.*;
class Solution {
public int[] solution(String msg) {
HashMap<String, Integer> map = new HashMap<>();
for (int i = 0; i < 26; i++) {
map.put(String.valueOf((char) ('A' + i)), i + 1);
}
ArrayList<Integer> result = new ArrayList<>();
@hye-ung97
hye-ung97 / Code.java
Created June 12, 2023 07:45
ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค-๋‘˜๋งŒ์˜ ์•”ํ˜ธ
import java.util.*;
class Solution {
public String solution(String s, String skip, int index) {
ArrayList<Character> list = new ArrayList<>();
for(int i = 0; i < 26; i++){
list.add((char) ('a' + i));
}
for(Character item : skip.toCharArray()){
@hye-ung97
hye-ung97 / photoScore.java
Created June 12, 2023 06:54
ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค-์ถ”์–ต์ ์ˆ˜
import java.util.*;
class Solution {
public int[] solution(String[] name, int[] yearning, String[][] photo) {
int[] answer = new int[photo.length];
HashMap<String, Integer> nameMap = new HashMap<>();
for(int i = 0; i < name.length; i++){
nameMap.put(name[i], yearning[i]);
}