목록2024/03/07 (3)
csct3434
문제 링크 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr import java.util.HashMap; import java.util.LinkedList; import java.util.List; class Solution { public long solution(int[] weights) { long answer = 0; HashMap countPerWeight = new HashMap(); HashMap torqueMap = new HashMap(); for (int k : weights) { countPerWeight.put(k, countPerWe..
문제 링크 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr import java.util.Arrays; import java.util.stream.IntStream; class Solution { public int solution(int[][] data, int col, int row_begin, int row_end) { Arrays.sort(data, (a, b) -> a[col - 1] == b[col - 1] ? b[0] - a[0] : a[col - 1] - b[col - 1]); return IntStream.rangeClosed(row_beg..
문제 링크 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr import java.util.Arrays; import java.util.HashSet; import java.util.Objects; import java.util.Set; class Solution { public String[] solution(int[][] line) { Set points = getPoints(line); return draw(points); } private Set getPoints(int[][] line) { HashSet points = new HashSet(); f..