목록분류 전체보기 (150)
코딩응급실
import java.math.BigInteger; public class Main { public static void main(String[] args) { int n =100; // 계산할 피보나치 수열의 항 번호 for (int i = 0; i
class Solution { public int solution(int n, int m, int[] section) { int need_to_draw = section[0]; int answer = 1; for (int i=1; i
class Solution { public int[] solution(String[] wallpaper) { int[] answer = new int[4]; int lux = wallpaper.length-1; // 행 int luy = wallpaper[0].length()-1; int rdx = 0; // 열 int rdy = 0; for (int r = 0; r r) lux = r; if (luy > c) luy = c; if (rdx < r) rdx = r; if (rdy < c..
class Solution { int[] dx = {0, 0, 1, -1}; int[] dy = {1, -1, 0, 0}; int moveX = -1; int moveY = -1; public int[] solution(String[] park, String[] routes) { int[] answer = new int[2]; char[][] arr = new char[park.length][park[0].length()]; for(int i=0; i
import java.util.HashMap; import java.util.Map; class Solution { public int[] solution(String[] name, int[] yearning, String[][] photo) { int[] answer = new int[photo.length]; // 각 사람에 대한 갈망 점수를 저장할 맵 생성 Map score = new HashMap(); // 주어진 이름과 해당하는 갈망 점수로 맵을 채움 for (int i=0; i
import java.util.HashMap; class Solution { public String[] solution(String[] players, String[] callings) { HashMap indexMap = new HashMap(); for (int i=0; i 0) { String temp = players[x-1]; //idx:2 poe players[x-1] = players[x]; //kai가 추월 players[x] = temp; indexMap.put(players[x-1], x-1); indexMap.put(players[x], x); } } return players; } public static void main(String[] args) { String[] player..