HackerRank-Python(90)
-
Prepare > Python > Date and Time > Calendar Module
Calendar Module | HackerRank Print the day of a given date. www.hackerrank.com 문제 Task You are given a date. Your task is to find what the day is on that date. Input Format A single line of input containing the space separated month, day and year, respectively, in MM DD YYYY format. Output Format Output the correct day in capital letters. => 일 월 년도 형식으로 날짜를 하나 줄건데, 요일을 대문자로 출력해라. 코드 import calen..
2023.08.21 -
Prepare > Python > Collections > Collections.deque()
Collections.deque() | HackerRank Perform multiple operations on a double-ended queue or deque. www.hackerrank.com 문제 Task Perform append, pop, popleft and appendleft methods on an empty deque d. Input Format The first line contains an integer N, the number of operations. The next N lines contains the space separated names of methods and their values. Output Format Print the space separated eleme..
2023.08.19 -
Prepare > Python > Collections > Collections.OrderedDict()
Collections.OrderedDict() | HackerRank Print a dictionary of items that retains its order. www.hackerrank.com 문제 Task You are the manager of a supermarket. You have a list of N items together with their prices that consumers bought on a particular day. Your task is to print each item_name and net_price in order of its first occurrence. item_name = Name of the item. net_price = Quantity of the it..
2023.08.18 -
Prepare > Python > Collections > Collections.namedtuple()
Collections.namedtuple() | HackerRank You need to turn tuples into convenient containers using collections.namedtuple(). www.hackerrank.com 문제 Task Dr. John Wesley has a spreadsheet containing a list of student's ID, MARKS, CLASS and NAME. Your task is to help Dr. Wesley calculate the average marks of the students. Input Format The first line contains an integer N, the total number of students. ..
2023.08.17 -
Prepare > Python > Collections > DefaultDict Tutorial
DefaultDict Tutorial | HackerRank Create dictionary value fields with predefined data types. www.hackerrank.com 문제 Input Format The first line contains integers, n and m separated by a space. The next n lines contains the words belonging to group A. The next m lines contains the words belonging to group B. Output Format Output m lines. The line should contain the -indexed positions of the occurr..
2023.08.16 -
Prepare > Python > Collections > collections.Counter()
collections.Counter() | HackerRank Use a counter to sum the amount of money earned by the shoe shop owner. www.hackerrank.com 문제 Task Mr.R is a shoe shop owner. His shop has S number of shoes. He has a list containing the size of each shoe he has in his shop. There are N number of customers who are willing to pay x(i) amount of money only if they get the shoe of their desired size. Your task is ..
2023.08.15 -
Prepare > Python > Itertools > itertools.combinations_with_replacement()
itertools.combinations_with_replacement() | HackerRank Find all the combinations of a string with replacements. www.hackerrank.com 문제 Task You are given a string S. Your task is to print all possible size k replacement combinations of the string in lexicographic sorted order. Input Format A single line containing the string S and integer value k separated by a space. Output Format Print the comb..
2023.08.14