프로그래머스 괄호 회전하기
·
코딩테스트(코틀린) 기초부터 연습
import java.util.* class Solution { fun solution(s: String): Int { var sq = LinkedList(s.map { it }) as Queue var count = 0 for (i in 1..s.length) { if (checkRight(sq)) count++ val first = sq.poll() sq.offer(first) } println(count) return count } fun checkRight(array: Queue): Boolean { val aq = LinkedList(array.map { it }) as Queue val aqs = Stack() while (aq.isNotEmpty()) { if (aqs.isEmpty()) {..