[BOJ] (Swift) 10809 - 알파벳 찾기
10809번: 알파벳 찾기 각각의 알파벳에 대해서, a가 처음 등장하는 위치, b가 처음 등장하는 위치, ... z가 처음 등장하는 위치를 공백으로 구분해서 출력한다. 만약, 어떤 알파벳이 단어에 포함되어 있지 않다면 -1을 출 www.acmicpc.net 풀이 import Foundation let S = Array(readLine()!) var result: [Int] = Array(repeating: -1, count: 26) for char in S { result[Int(char.asciiValue!) - 97] = S.firstIndex(of: char)! } print(result.map{ String($0) }.joined(separator: " "))
Algorithm/백준
2022. 8. 5. 01:25
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 1406 에디터
- BOJ 10799
- 2023 회고
- bottom sheet
- Card CollectionVIew
- sheetPresentationController
- BOJ 17413
- UICollectionView Error
- UICollectionView banner
- CAGradientLayer
- Carousel Effect
- 요시푸스
- swift
- BOJ 10809
- BOJ 17298
- NaverMaps
- crud
- autolayout
- BOJ 10808
- github
- Custom Detent
- BOJ 10820
- ios
- Sheet Height
- BOJ 1935
- BOJ 10866
- Algorithm
- Gradient View
- Stack
- git
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
글 보관함