We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 353a927 commit fd89ca7Copy full SHA for fd89ca7
.DS_Store
0 Bytes
스택, 큐/2164_카드2.swift
@@ -0,0 +1,19 @@
1
+let N = Int(readLine() ?? "")!
2
+
3
4
+if 1 <= N && N <= 500000 {
5
+ var cards: [Int] = []
6
+ var head = 0
7
8
+ for num in 1...N {
9
+ cards.append(num)
10
+ }
11
12
+ while head != cards.count-1 {
13
+ head += 1
14
+ cards.append(cards[head])
15
16
17
18
+ print(cards[head])
19
+}
0 commit comments