문제풀이/구현 42

@ [JAVA] Pro 뉴스 클러스터링

문제 https://school.programmers.co.kr/learn/courses/30/lessons/17677 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 코드 import java.util.*; class Solution { public int solution(String str1, String str2) { int answer=0; List list1=new ArrayList(); List list2=new ArrayList(); for(int i=0; i

문제풀이/구현 2023.11.30

@ [JAVA] Pro 프렌즈4블록

문제 https://school.programmers.co.kr/learn/courses/30/lessons/17679 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 코드 class Solution { Character[][] arr; int gm; int gn; int answer; // 2x2 찾고 지우기 public int find(){ int total=0; // 사라질 블록인지 체크 boolean[][] visited=new boolean[gm][gn]; for(int i=0; i

문제풀이/구현 2023.11.29

[JAVA] Pro 튜플

문제 https://school.programmers.co.kr/learn/courses/30/lessons/64065 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 코드 import java.util.*; class Solution { public int[] solution(String s) { List answer = new ArrayList(); List list = new ArrayList(); Set set = new HashSet(); // 맨 앞, 맨 뒤를 잘라줌 s=s.substring(1,s.length()-1); // "{"를 기준으로 ..

문제풀이/구현 2023.11.07

@ [JAVA] Pro 삼각 달팽이

문제 https://school.programmers.co.kr/learn/courses/30/lessons/68645 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 코드 import java.util.*; class Solution { public int[] solution(int n) { List answer = new ArrayList(); int count=0; for(int i=1; i

문제풀이/구현 2023.11.05

@ [JAVA] Pro 교점에 별 만들기

문제 https://school.programmers.co.kr/learn/courses/30/lessons/87377 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 코드 import java.util.*; class Solution { Set result = new HashSet(); public void cal(int[] lineA, int[] lineB){ long A=lineA[0]; long B=lineA[1]; long E=lineA[2]; long C=lineB[0]; long D=lineB[1]; long F=lineB[2]; if(A*D-..

문제풀이/구현 2023.10.27

[JAVA] [구현] Pro 기둥과 보 설치

문제 https://school.programmers.co.kr/learn/courses/30/lessons/60061 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 코드 import java.util.*; class Solution { static ArrayList nodes = new ArrayList(); static class Node{ int x; int y; int type; // 보, 기둥 Node(int x, int y, int type){ this.x=x; this.y=y; this.type=type; } @Override public b..

문제풀이/구현 2023.09.20

[JAVA] [구현] 백준 20006 랭킹전 대기열

문제 https://www.acmicpc.net/problem/20006 20006번: 랭킹전 대기열 모든 생성된 방에 대해서 게임의 시작 유무와 방에 들어있는 플레이어들의 레벨과 아이디를 출력한다. 시작 유무와 플레이어의 정보들은 줄 바꿈으로 구분되며 레벨과 아이디는 한 줄에서 공백 www.acmicpc.net 코드 import java.util.*; import java.io.*; public class b20006 { public static class player{ int level; String nickname; public player(int level, String nickname){ this.level=level; this.nickname=nickname; } } public static ..

문제풀이/구현 2023.08.02

[JAVA] [구현] Pro 성격 유형 검사하기

문제 https://school.programmers.co.kr/learn/courses/30/lessons/118666?language=java 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 코드 class Solution { public String solution(String[] survey, int[] choices) { String answer = ""; // 유형별 점수 합 int[] arr=new int[8]; // 선택 결과를 바탕으로 해당 유형에 점수 추가 for(int i=0; i

문제풀이/구현 2023.07.31

[JAVA] [구현] Pro 테이블 해시 함수

문제 https://school.programmers.co.kr/learn/courses/30/lessons/147354?language=java 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 코드 import java.util.*; class Solution { public int solution(int[][] data, int col, int row_begin, int row_end) { int answer = 0; Arrays.sort(data, (o1,o2) -> { return o1[col-1]==o2[col-1] ? o2[0]-o1[0] : o..

문제풀이/구현 2023.07.11