[Swift] ๋ฐฑ์ค€1181
ยท
๐Ÿ“ ์ฝ”ํ…Œ/BOJ
import Foundation let n = Int(readLine()!)! var arr = [String]() for _ in 0 ..< n { let input = readLine()! arr.append(input) } // ์ค‘๋ณต์ œ๊ฑฐ arr = Array(Set(arr)) // ๊ธธ์ด์‚ฌ์ „์ˆœ + ์งง์€ ์ˆœ arr = arr.sorted(by: { $0 < $1 }).sorted(by: { $0.count < $1.count }) for string in arr { print(string) }
[Swift] ๋ฐฑ์ค€1259
ยท
๐Ÿ“ ์ฝ”ํ…Œ/BOJ
import Foundation var input = "" while true { input = readLine()! if input == "0" { break } print(input == String(input.reversed()) ? "yes" : "no") }
[Swift] ๋ฐฑ์ค€ 1085 ์ง์‚ฌ๊ฐํ˜•์—์„œ ํƒˆ์ถœ
ยท
๐Ÿ“ ์ฝ”ํ…Œ/BOJ
import Foundation let input = readLine()!.components(separatedBy: " ").map { Int($0)! } let x = input[0] let y = input[1] let w = input[2] let h = input[3] print(min(w - x, x, h - y, y)) ๋จธ๋ฆฟ์†์œผ๋กœ ์ขŒํ‘œ๊ณ„ ์ƒ์ƒํ•˜๋ฉด์„œ ๊ฐ„๋‹จํ•˜๊ฒŒ ํ’€์—ˆ๋‹ค.
[Swift] ๋ฐฑ์ค€1018
ยท
๐Ÿ“ ์ฝ”ํ…Œ/BOJ
let mn = readLine()!.split(separator: " ").map{Int($0)!} let m = mn[0] let n = mn[1] var board = [[String]]() for _ in 0..
[Swift] ๋ฐฑ์ค€ 2475
ยท
๐Ÿ“ ์ฝ”ํ…Œ/BOJ
let input = readLine()!.split(separator: " ").map { Int($0)! * Int($0)! }.reduce(0, +) print(input % 10) ์ˆซ์ž๋“ค์˜ ํ•ฉ์„ ๋”ํ• ๋•Œ๋Š” .reduce(0, +)๋ฅผ ์“ฐ๋ฉด ํŽธํ•˜๋‹ค.
JerryiOS
'๐Ÿ“ ์ฝ”ํ…Œ' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๊ธ€ ๋ชฉ๋ก (6 Page)