์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
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 |
- Do_it
- Extended Slices
- Do it
- ์ด๊ฒ์ด ์ทจ์ ์ ์ํ ์ฝ๋ฉํ ์คํธ๋ค
- java
- jdbc
- ๋ธ๋ผ์ฐ์ ์คํ
- ์ต์
- ์ฐธ์กฐ ๋ณ์
- ๋ฐ์ค๊ทธ๋ํ
- DFS
- matplotlib
- ์ง ๊ฐ ์์ธก ๋ถ์
- ํ์ ๋ณ์
- mysql
- ๋ฐฑ์ค
- ํ๋ก๊ทธ๋๋จธ์ค
- np.zeros_like
- ์์ด
- ์ด์ง์ ๋ณํ
- MacOS
- 2BPerfect
- ์ ํ ํฌ ํ์ด์ฌ
- ํฉํ ๋ฆฌ์ผ ์ง๋ฒ
- sql
- PYTHON
- dacon
- ๋ค์ต์คํธ๋ผ ์๊ณ ๋ฆฌ์ฆ
- ์๋ฐ
- BFS
- Today
- Total
๋ชฉ๋กDevelopment/CodingTest (34)
๐ฆ ๊ณต๋ฃก์ด ๋์!
def solution(phone_book): phone_book.sort() for i, j in zip(phone_book, phone_book[1:]): if j.startswith(i): return False return True ํด์ฌ def solution(phone_book): answer = True hash_map = {} for phone_number in phone_book: hash_map[phone_number] = 1 for phone_number in phone_book: temp = "" for number in phone_number: temp += number if temp in hash_map and temp != phone_number: answer = False re..
a1='abcdefghijklmnopqrstuvwxyz' b1=int(input()) b2=list(input()) a3=[(a1.index(i)+1)*(31**j) for i,j in zip(b2,range(b1))] print(sum(a3)%1234567891) ๋ค๋ฅธ ๋ต์ L = int(input()) string = input() answer = 0 for i in range(L): answer += (ord(string[i])-96) * (31 ** i) #์์คํค ์ฝ๋ ๊ฐ์ ๋๋ ค์ฃผ๋ ordํจ์ print(answer % 1234567891)
def solution(participant, completion): p=sorted(participant) c=sorted(completion) for i in range(len(c)): if p[i] != c[i]: return p[i] return p[len(p)-1] hash๋ฅผ ์ด์ฉํ ํ์ด def solution(participant, completion): answer = '' temp = 0 dic = {} for part in participant: dic[hash(part)] = part temp += int(hash(part)) for com in completion: temp -= hash(com) answer = dic[temp] return answer ...ํ์์ ์ด๋ค.....
์์์ ๊ธธ์ด๋ฅผ ๊ฐ๋ ๋ฉ์์ง๋ฅผ ์ ๋ ฅ๋ฐ์ ๊ณ ์ ๋ ๊ธธ์ด์ ํด์๊ฐ์ ์ถ๋ ฅํ๋ ํจ์ ๋์ ๋๋ฆฌ ์ฝ์ hash=dict() hash={} hash[1]='apple' hash['banana']=3 hash[(4,5)]=[1,2,3] hash[10] = dict({1:'a',2:'b'}) ๋์ ๋๋ฆฌ ์์ hash[1]='melon' hash['banana']=10 ๋์ ๋๋ฆฌ ๊ฐ ์ถ์ถ hash.pop(1) 'melon' hash.pop('banana') 10 hash.pop((4,5)) [1,2,3] hash.pop(10) {1:'a',2:'b'} ๋์ ๋๋ฆฌ ์ญ์ del hash[1] del hash['banana'] ๋์ ๋๋ฆฌ ํ์ฉ ๋์ ๋๋ฆฌ ๋ฃจํ hash = dict() hash.keys() ํค ๊ฐ ์ถ์ถ hash.values..
์ ์ฒด ์ฝ๋ def solution(n, arr1, arr2): answer=[] for i,j in zip(arr1,arr2): tmp=str(bin(i|j)[2:]) tmp=tmp.zfill(n) tmp=tmp.replace('1','#') tmp=tmp.replace('0',' ') answer.append(tmp) return answer ๋ฌธ์์ด ์ ๋ ฌ ljust,center,rjust,zfill() st.ljust(x) ์ข์ธก ์ ๋ ฌ st.center(x) ๊ฐ์ด๋ฐ ์ ๋ ฌ st.rjust(x) ์ฐ์ธก ์ ๋ ฌ "01".rjsut(4,'0') >>>"0001" "01".ljsut(4,'0') >>>"0100" "2".zfill(4) >>> "0002" "512".zfill(4) >>>"0512" ํ ์ค ์ฝ๋.....
์ ์ฒด ์ฝ๋ a1,b1=input().split() b1=int(b1) num='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' result=0 for a in range(0,len(a1)): result+=num.index(a1[a])*(b1**(len(a1)-1-a)) print(result) ์ฝ๋๋ฆฌ๋ทฐ a1,b1=input().split() b1=int(b1) num='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' result=0 for a in range(0,len(a1)): result+=num.index(a1[a])*(b1**(len(a1)-1-a))//0๋ฒ์งธ ์ธ๋ฑ์ค๋ถํฐ ์ฐจ๋ก๋ก ๋ถ๋ฌ์ ํด๋นํ๋ ์๋ฆฟ์์ ๊ฐ์ ๊ณฑ print(result) ์ด๋ฒ ๊ฑด ๋ฆฌ๋ทฐํ ๊ฒ ํน..