Skip to content

Conversation

@ShinHeeEul
Copy link
Contributor

@ShinHeeEul ShinHeeEul commented Feb 6, 2025

🧷 문제 링크

https://swexpertacademy.com/main/code/problem/problemSolverCodeDetail.do

🧭 풀이 시간

10 분

👀 체감 난이도

✏️ 문제 설명

원본 암호문에 다음과 같은 연산을 더한다.

  1. I(삽입) x, y, s : 앞에서부터 x번째 암호문 바로 다음에 y개의 암호문을 삽입한다. s는 덧붙일 암호문들이다.[ ex) I 3 2 123152 487651 ]
  2. D(삭제) x, y : 앞에서부터 x번째 암호문 바로 다음부터 y개의 암호문을 삭제한다.[ ex) D 4 4 ]
  3. A(추가) y, s : 암호문 뭉치 맨 뒤에 y개의 암호문을 덧붙인다. s는 덧붙일 암호문들이다. [ ex) A 2 421257 796813 ]

위 규칙에 맞게 명령어 연산을 수행하고 결과 배열의 0번부터 10번을 출력하라.

🔍 풀이 방법

ArrayList의 add, remove, addAll을 활용하여 연산자에 맞게 계산하고, 마지막에 10개 출력

⏳ 회고

입력량이 많고, 반복문이 꽤 있어서 비효율적으로 짰다 싶었는데, 시간복잡도 괜찮게 나와서 그냥 넘어가기로 했다.

@ShinHeeEul ShinHeeEul added the success 👍 해설을 보지 않고 풀었을 때 label Feb 6, 2025
@ShinHeeEul ShinHeeEul self-assigned this Feb 6, 2025
@ShinHeeEul ShinHeeEul merged commit badf30a into main Feb 6, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

success 👍 해설을 보지 않고 풀었을 때

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants