전체 글
-
Practice>Python>Sets>Set .union() Operationhackerrank.com 2019. 2. 26. 12:52
hackerrank.comSet .union() OperationProblem link : https://www.hackerrank.com/challenges/py-set-union/problemDifficulty : Easy TipIf you understand how set() is used, it's simple questionDon't forget to split string to each item for set() Solution input() s = input() s1 = set(s.split(" ")) input() s = input() s2 = set(s.split(" ")) su = s1.union(s2) print(len(su))
-
Practice>Python>Collections>Word Orderhackerrank.com 2019. 2. 25. 13:16
hackerrank.comWord OrderProblem link : https://www.hackerrank.com/challenges/word-order/problemDifficulty : Medium TipProblem is to check that you utilize defaultdictUse input as a key of defaultdict+1 as per input word Solution from collections import defaultdict dic = defaultdict(int) cnt = int(input()) for _ in range(cnt): w = input() dic[w] += 1 print(len(dic)) v = dic.values() v = list(v) s..
-
Practice>Python>Errors and Exceptions>Incorrect Regexhackerrank.com 2019. 2. 25. 04:24
hackerrank.comIncorrect RegexProblem link : https://www.hackerrank.com/challenges/incorrect-regex/problemDifficulty : Easy TipProblem ask how to validate regular expressionJust call re.compile(), it will raise exception if the given regular expression is not valid Solution import re cnt = int(input()) for _ in range(cnt): try: re.compile(input()) print(True) except: print(False)
-
Practice>Python>Math>Power - Mod Powerhackerrank.com 2019. 2. 24. 13:52
hackerrank.comPower - Mod PowerProblem link : https://www.hackerrank.com/challenges/python-power-mod-power/problem?utm_campaign=challenge-recommendation&utm_medium=email&utm_source=24-hour-campaign&h_r=next-challenge&h_v=zenDifficulty : Easy TipVery simple/easy problemJust do as problem description :) Solution a = int(input()) b = int(input()) m = int(input()) print(pow(a, b)) print(pow(a, b, m))
-
hackerrank.com Practice>Python>Math>Mod Divmodhackerrank.com 2019. 2. 24. 13:39
hackerrank.com Mod DivmodProblem link : https://www.hackerrank.com/challenges/python-mod-divmod/problem?utm_campaign=challenge-recommendation&utm_medium=email&utm_source=24-hour-campaignDifficulty : Easy Tipdivmod() return as tupletuple can be accessible like array such as r[0] r[1] Soulution a = int(input()) b = int(input()) r = divmod(a, b) print(r[0]) print(r[1]) print(r)
-
Practice>Python>Math>Triangle Quest 2hackerrank.com 2019. 2. 22. 13:22
Triangle Quest 2Problem link : https://www.hackerrank.com/challenges/triangle-quest-2/problemDifficulty : Medium TipThis problem is not easy as we can use only one lineOne line means that we can't use any functionAs a first step,1 x 1 = 111 x 11 = 121111 x 111 = 12321So, how do we create 1, 11, 111 from 1, 2, 3(10**i)//9
-
Practice>Python>Date and Time>Time Deltahackerrank.com 2019. 2. 17. 08:14
Time DeltaProblem link : https://www.hackerrank.com/challenges/python-time-delta/problemDifficulty : MediumTipFirst of all, we should convert timestamp string to datetimeWe should write a format string, to describe the meaning of timestamp string For example, 'Sun' means the Sunday, to convert 'Sun' to Sunday(as a part of datetime), format string should be '%a'datetime is good class to convert w..
-
My projects for Udacity Deep Learning Nanodegree Program카테고리 없음 2019. 2. 16. 15:01
My projects for Udacity Deep Learning Nanodegree ProgramThis repository contains all of my projects for Udacity/Data Deep Learning Nanodegree Program.I hope that my projects help to another student’s study as a good reference. https://skysign.github.io/udacity-DLNP/ByeongKeon Kim (skysign at gmail.com)