From 013eb426c6e3aee1ebad961e657b3c6ac7fc7c9e Mon Sep 17 00:00:00 2001 From: 1304-lukeyu Date: Sun, 1 Mar 2026 18:24:18 +0900 Subject: [PATCH] =?UTF-8?q?[296=EC=9D=BC=EC=B0=A8]=20=EB=85=B8=EA=B0=80?= =?UTF-8?q?=EC=9A=B0=20/=20=EC=BD=9C=EB=9D=BC=EC=B8=A0=20=EC=88=98?= =?UTF-8?q?=EC=97=B4=20=EB=A7=8C=EB=93=A4=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://school.programmers.co.kr/learn/courses/30/lessons/181919 --- ...264 \353\247\214\353\223\244\352\270\260.java" | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 "4st/Gau/programmer/\354\275\234\353\235\274\354\270\240 \354\210\230\354\227\264 \353\247\214\353\223\244\352\270\260.java" diff --git "a/4st/Gau/programmer/\354\275\234\353\235\274\354\270\240 \354\210\230\354\227\264 \353\247\214\353\223\244\352\270\260.java" "b/4st/Gau/programmer/\354\275\234\353\235\274\354\270\240 \354\210\230\354\227\264 \353\247\214\353\223\244\352\270\260.java" new file mode 100644 index 00000000..c55bd3da --- /dev/null +++ "b/4st/Gau/programmer/\354\275\234\353\235\274\354\270\240 \354\210\230\354\227\264 \353\247\214\353\223\244\352\270\260.java" @@ -0,0 +1,15 @@ +class Solution { + public int[] solution(int n) { + String str = n + " "; + while (n != 1) { + n = n % 2 == 0 ? n / 2 : 3 * n + 1; + str += n + " "; + } + String[] arr = str.split(" "); + int[] answer = new int[arr.length]; + for(int i=0; i