일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 보안
- git
- var
- nginx
- TypeScript
- scss
- dotenv
- type
- bash
- C++
- docker
- BOJ
- leetcode
- 앙상블
- npm
- webpack
- vuetify
- generic
- loop
- JavaScript
- condition
- security
- Clone
- C#
- AI
- property
- VUE
- vue.js
- machine learning
- Python
- Today
- Total
목록PS (53)
ice rabbit programming
programmers.co.kr/learn/courses/30/lessons/72410 코딩테스트 연습 - 신규 아이디 추천 카카오에 입사한 신입 개발자 네오는 "카카오계정개발팀"에 배치되어, 카카오 서비스에 가입하는 유저들의 아이디를 생성하는 업무를 담당하게 되었습니다. "네오"에게 주어진 첫 업무는 새로 programmers.co.kr 2021년 카카오 블라인드 신규 채용 A번 문제였던 신규 아이디 추천이다. 당시에도 코테를 한 번 볼 요량으로 신청했었는데, 그 때도 어렵지 않게 풀었던 문제이다. 이번에 다시 풀어보아 기록을 티스토리에도 남기려 한다. 공식 해답은 카카오 기술 블로그에 자세히 나와 있다. 문제는 그렇게 어렵지 않고, 단계별로 자세히 나아갈 길을 알려 준다(1. 대문자를 제거해라, 2...
leetcode.com/problems/power-of-two/ Power of Two - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 제목 그대로, 입력된 숫자가 2의 제곱수인지를 판별하는 문제이다. 고전적으로 계속 2로 나누는 방식을 선택했는데, 무리없이 해결되었다. class Solution: def isPowerOfTwo(self, n: int) -> bool: if n 1: if n%2 != 0: re..
leetcode.com/problems/contains-duplicate/ Contains Duplicate - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 주어진 배열에서, 원소가 두 번 등장하는지를 체크하는 문제이다. 파이썬에서 set은 중복을 허용하지 않는 자료구조임을 이용하여 풀었다. class Solution: def containsDuplicate(self, nums: List[int]) -> bool: return len(nums) != len(s..
leetcode.com/problems/number-of-1-bits/ Number of 1 Bits - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 정수형으로 들어온 숫자에 대해, 이진수로 변환했을 때 1인 비트의 개수를 구하는 문제이다. 파이썬으로 풀었더니, 내장 함수에 의해서 쉽게 구현할 수 있었다. class Solution: def hammingWeight(self, n: int) -> int: return str(bin(n)).count('1')
leetcode.com/problems/reverse-bits/ Reverse Bits - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 32비트로 고정된 길이의 input을 받아 뒤집어 10진수로 변환하는 문제이다. 파이썬의 내장 함수인 bin()를 사용하면, 이진수로 바꿀 수 있다. 예를들어 4는 0b100 으로 변환된다. 앞에 0b가 붙는 것과, 32비트로 고정된 길이지만 앞의 padding용 0은 지워진다는 점을 이용해, 변환 후 앞 2문자를 제거하고 길..
leetcode.com/problems/find-the-difference/ Find the Difference - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문자열이 두 개 주어지는데, 임의의 위치에서 하나의 문자가 다르게 들어오는데, 이 문자를 찾는 문제이다. 두 문자를 모두 정렬한 후에 비교해서 다른 index의 문자를 반환하는 식으로 풀었다. class Solution: def findTheDifference(self, s: str, t: str) -..
leetcode.com/problems/find-all-numbers-disappeared-in-an-array/ Find All Numbers Disappeared in an Array - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com PS를 C++로 풀다가 C#으로 풀고, 이제는 Python으로 풀고 있다. Python이 확실히 내장 함수도 많고 숏코딩에 적합해서 훨씬 편하긴 한 것 같다. 물론 로직 고민은 똑같지만.. 이 문제는 1~배열길이 숫자들이 1번 ..
www.acmicpc.net/problem/17219 17219번: 비밀번호 찾기 첫째 줄에 저장된 사이트 주소의 수 N(1 ≤ N ≤ 100,000)과 비밀번호를 찾으려는 사이트 주소의 수 M(1 ≤ M ≤ 100,000)이 주어진다. 두번째 줄부터 N개의 줄에 걸쳐 각 줄에 사이트 주소와 비밀번�� www.acmicpc.net 사이트와 패스워드를 받아 저장한 후에 사이트에 맞는 패스워드를 반환하면 된다. n, m = map(int, input().split()) passwords = {} for index in range(n): url, password = input().split() passwords[url] = password for index in range(m): url = input() pr..