소스범벅
close
프로필 배경
프로필 로고

소스범벅

  • All (81)
    • ✨ Programming (21)
      • Java (3)
      • Spring (8)
      • Architecture (1)
      • Tool (8)
      • 문제&버그 (1)
    • ✨ Algorithm (55)
      • 백준 (31)
      • 프로그래머스 (24)
      • 개념 (0)
    • ✨ CS (2)
      • 자료구조 (0)
      • 운영체제 (0)
      • 네트워크 (2)
      • 데이터베이스 (0)
    • ✨ 독서 (3)
  • 깃허브
  • 방명록
[알고리즘] 프로그래머스 120899번 가장 큰 수 찾기 (자바|Java)

[알고리즘] 프로그래머스 120899번 가장 큰 수 찾기 (자바|Java)

1. 문제 2. 풀이 ver1. 코드 정리 전 class Solution { public int[] solution(int[] array) { int[] answer = {}; answer = new int[2]; int max = array[0]; int maxIndex = 0; for(int i = 1; i < array.length; i++) { if(max < array[i]) { max = array[i]; maxIndex = i; } } answer[0] = max; answer[1] = maxIndex; return answer; } } ver2. 코드 정리 후 class Solution { public int[] solution(int[] array) { int[] answer = {}; ..

  • format_list_bulleted ✨ Algorithm/프로그래머스
  • · 2023. 3. 6.
  • textsms
[알고리즘] 프로그래머스 120895번 인덱스 바꾸기 (자바|Java)

[알고리즘] 프로그래머스 120895번 인덱스 바꾸기 (자바|Java)

1. 문제 2. 풀이 ver1. join() 활용하기 class Solution { public String solution(String my_string, int num1, int num2) { String answer = ""; String[] tmp = new String[1]; String[] arr = my_string.split(""); tmp[0]= arr[num1]; arr[num1] = arr[num2]; arr[num2] = tmp[0]; answer = String.join("", arr); return answer; } } ver2. StringBuilder() 활용하기 class Solution { public String solution(String my_string, int n..

  • format_list_bulleted ✨ Algorithm/프로그래머스
  • · 2023. 3. 5.
  • textsms
[알고리즘] 프로그래머스 120845번 주사위의 개수 (자바|Java)

[알고리즘] 프로그래머스 120845번 주사위의 개수 (자바|Java)

1. 문제 2. 풀이 class Solution { public int solution(int[] box, int n) { int answer = 0; answer = 1; for(int i = 0; i < box.length; i++) { answer *= (box[i] / n); } return answer; } }

  • format_list_bulleted ✨ Algorithm/프로그래머스
  • · 2023. 3. 3.
  • textsms
[알고리즘] 프로그래머스 120905번 n의 배수 고르기 (자바|Java)

[알고리즘] 프로그래머스 120905번 n의 배수 고르기 (자바|Java)

1. 문제 2. 풀이 import java.util.Arrays; class Solution { public int[] solution(int n, int[] numlist) { int[] answer = {}; answer = Arrays.stream(numlist).filter(value -> value % n == 0).toArray(); return answer; } } 3. 참고 https://developer-talk.tistory.com/707 [Java]배열에서 특정 값 제거하는 방법 배열에서 특정 값 제거하는 방법 Java는 배열에서 특정 값을 제거하는 메서드를 제공하지 않습니다. 외부 라이브러리 Apache Commons를 사용하면 배열의 요소를 제거할 수 있지만, 이번 포스팅은 외 d..

  • format_list_bulleted ✨ Algorithm/프로그래머스
  • · 2023. 3. 2.
  • textsms
[알고리즘] 프로그래머스 120850번 문자열 정렬하기 (1) (자바|Java)

[알고리즘] 프로그래머스 120850번 문자열 정렬하기 (1) (자바|Java)

1. 문제 2. 풀이 import java.util.Arrays; class Solution { public int[] solution(String my_string) { int[] answer = {}; String[] arr = my_string.replaceAll("[a-z]", "").split(""); answer = Arrays.stream(arr).mapToInt(Integer::parseInt).toArray(); Arrays.sort(answer); return answer; } } 3. 참고 https://velog.io/@suyyeon/JAVA-String-%EB%B0%B0%EC%97%B4%EC%9D%84-int-%EB%B0%B0%EC%97%B4%EB%A1%9C-%EB%B3%80%ED..

  • format_list_bulleted ✨ Algorithm/프로그래머스
  • · 2023. 3. 1.
  • textsms
[알고리즘] 프로그래머스 120834번 외계행성의 나이 (자바|Java)

[알고리즘] 프로그래머스 120834번 외계행성의 나이 (자바|Java)

1. 문제 2. 풀이 ver1. class Solution { public String solution(int age) { String answer = ""; String[] arr = String.valueOf(age).split(""); for(int i = 0; i < arr.length; i++) { answer += (char)(Integer.valueOf(arr[i]) + 97); } return answer; } } ver2. class Solution { public String solution(int age) { String answer = ""; char[] arr = String.valueOf(age).toCharArray(); for(int i = 0; i < arr.length; ..

  • format_list_bulleted ✨ Algorithm/프로그래머스
  • · 2023. 2. 3.
  • textsms
  • navigate_before
  • 1
  • 2
  • 3
  • 4
  • navigate_next
전체 카테고리
  • All (81)
    • ✨ Programming (21)
      • Java (3)
      • Spring (8)
      • Architecture (1)
      • Tool (8)
      • 문제&버그 (1)
    • ✨ Algorithm (55)
      • 백준 (31)
      • 프로그래머스 (24)
      • 개념 (0)
    • ✨ CS (2)
      • 자료구조 (0)
      • 운영체제 (0)
      • 네트워크 (2)
      • 데이터베이스 (0)
    • ✨ 독서 (3)
전체 방문자
오늘
어제
전체
Copyright © 쭈미로운 생활 All rights reserved.
Designed by JJuum

티스토리툴바