2019-10-18

12시간제를 24시간제로 시간증가하여 변환

12시간제를 24시간제로 시간증가하여 변환 목표 자연수 N을 오름차순과 내림차순으로 각각 정렬하여 두 값을 합산한 결과를 반환하시요 조건 time의 값은 오전과 오후가 각각 “AM”, “PM” 으로 표시하며 12시간제로 “시:분:초” 의 형태를 가짐 시분초는 한자리 수라도 두자리로 표시 N <= 200,000 예시 time n result AM 12:01:00 1 00:01:01 PM 12:01:00 2 12:01:02 PM 09:01:40 50 21:02:10 AM 11:01:00 3700 00:02:40 코드 import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; public...

숫자를 정렬,역정렬하여 합산

숫자를 정렬,역정렬하여 합산 목표 자연수 N을 오름차순과 내림차순으로 각각 정렬하여 두 값을 합산한 결과를 반환하시요 조건 N >= 1 || N <= 1,000,000,000 예시 N process result 2613 1236 + 6321 7557 33285 23358 + 85332 108690 코드 import java.util.*; public class Solution { public int solution(int N) { int answer = -1; char[] splitNum = String.valueOf(N).toCharArray(); Arrays.sort(splitNum); ...

쌍이 아닌 배열값 검사

쌍이 아닌 배열값 검사 목표 cards 배열에서 쌍이 아닌 개체값 을 반환하시요. 조건 cards.length = N * 2 - 1 N >= 1,000,000 cards 개체값 >= 100,000,000 예시 cards answer [1,3,2,2,5,5,1] 3 [7,2,3,9,1,2,5,3,9,7,1] 5 코드 import java.util.*; import java.util.Arrays; class Solution { public int solution(int[] cards) throws NoSuchElementException{ // cards.length = 짝수 // cards...

정보를 저장하는 구조, Data Structure

정보를 저장하는 구조, Data Structure 자료구조 (Data Structure) 자료 구조란, 기본 자료형 (Primitive Data Structure) 생략 비기본 자료형, 사용자 정의 자료형 (Non-Primitive Data Structure) 선형 자료구조 (Linear Data Structure) Arrays Linked List Stack Queue 비선형 자료구조 (Non-Linear Data Structure) Tree Graphs ...