
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
- UICollectionView banner
- Custom Detent
- BOJ 10799
- Card CollectionVIew
- Carousel Effect
- ios
- 요시푸스
- BOJ 1935
- Stack
- sheetPresentationController
- 1406 에디터
- BOJ 10820
- swift
- bottom sheet
- NaverMaps
- crud
- autolayout
- BOJ 10808
- Gradient View
- BOJ 17298
- git
- github
- CAGradientLayer
- Sheet Height
- UICollectionView Error
- Algorithm
- 2023 회고
- BOJ 17413
- BOJ 10809
- BOJ 10866
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함