Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 | 31 |
Tags
- 파이썬
- Python
- Lv. 2
- bfs
- 동적계획법
- 백준
- join
- LEVEL 2
- softeer
- 자바스크립트
- Java
- 프로그래머스
- javascript
- SQL
- 소프티어
- group by
- 오블완
- Dynamic Programming
- Lv. 1
- Lv. 0
- DP
- 깊이 우선 탐색
- dfs
- programmers
- level 3
- SQL 고득점 KIT
- Baekjoon
- Lv. 3
- 너비 우선 탐색
- 티스토리챌린지
Archives
- Today
- Total
몸과 마음이 건전한 SW 개발자
[HackerRank-MSSQL] 해커랭크 basic select Weather Observation Station 11 본문
SQL/MSSQL
[HackerRank-MSSQL] 해커랭크 basic select Weather Observation Station 11
스위태니 2026. 4. 17. 14:04문제 링크
https://www.hackerrank.com/challenges/weather-observation-station-11/problem?isFullScreen=true
Weather Observation Station 11 | HackerRank
Query a list of CITY names not starting or ending with vowels.
www.hackerrank.com
정답 코드
select distinct city from station where city not like '[aeiou]%[aeiou]';
풀이 과정
- city의 앞 문자가 a e i o u로 시작하지 않고 뒷 문자가 a e i o u로 끝나지 않고 라는 명제가 있다.
- '[^aeiou]%' and '%[^aeiou]'
- 이 명제를 대우로 표현하면 a e i o u로 시작하고 a e i o u로 끝나는 city가 된다.
- '[aeiou]%[aeiou]'
- 위의 대우 명제를 not like로 부정하면
- not like '[aeiou]%[aeiou]'가 된다.

느낀점
- 명제, 역, 이, 대우에 대한 것을 배웠지만 언제 써먹을까 생각했다.
- 마침 좋은 문제 같아서 기록으로 남긴다.