HackerRank-Python(90)
-
Prepare > Regex > Introduction > Matching Anything But a Newline
Matching Anything But a Newline | HackerRank Use [.] in the regex expression to match anything but a newline character. www.hackerrank.com 문제 Task You have a test string S. Your task is to write a regular expression that matches only and exactly strings of form: abc.def.hki.xkj, where each variable a, b, c, d, e, f, h, k, i, j, k, x can be any single character except the newline. => 문자 3자리 와 .(점..
2023.10.06 -
Prepare > Regex > Introduction > Matching Specific String
문제 Task You have a test string . Your task is to match the string hackerrank. This is case sensitive. Note This is a regex only challenge. You are not required to write code. You only have to fill in the regex pattern in the blank (_________). => 빈칸에 정규표현식을 넣어, 문자열 S에 hackerrank 가 몇 번 나오는지 찾아라 코드 Regex_Pattern = r'hackerrank'# Do not delete 'r'. import re Test_String = input() match = re.findall..
2023.10.05 -
Prepare > Python > Python Functionals > Validating Email Addresses With a Filter
Validating Email Addresses With a Filter | HackerRank This question covers the concept of filters. www.hackerrank.com 문제 Valid email addresses must follow these rules: It must have the username@websitename.extension format type. The username can only contain letters, digits, dashes and underscores [a-z], [A-Z], [0-9], [-_]. The website name can only have letters and digits [a-z], [A-Z], [0-9] . ..
2023.10.04 -
Prepare > Python > Python Functionals > Reduce Function
Reduce Function | HackerRank Python Practice www.hackerrank.com 문제 => 유리수의 개수 n 과, 공백으로 분리된 분자, 분모들을 인풋해줄건데, 유리수들을 곱해서 나오는 값의 분자, 분모를 출력해라. 코드 from fractions import Fraction from functools import reduce def product(fracs): t = reduce(lambda x, y: x * y, fracs) return t.numerator, t.denominator if __name__ == '__main__': fracs = [] for _ in range(int(input())): fracs.append(Fraction(*map(int, inp..
2023.10.03 -
Prepare > Python > Built-Ins > ginortS
ginortS | HackerRank An uneasy sort. www.hackerrank.com 문제 you are given a string S. S contains alphanumeric characters only. All sorted lowercase letters are ahead of uppercase letters. All sorted uppercase letters are ahead of digits. All sorted odd digits are ahead of sorted even digits. Input Format A single line of input contains the string S. Output Format Output the sorted string S. => S에..
2023.10.02 -
Prepare > Python > Built-Ins > Athlete Sort
Athlete Sort | HackerRank Sort the table on the kth attribute. www.hackerrank.com 문제 You are given a spreadsheet that contains a list of N athletes and their details (such as age, height, weight and so on). You are required to sort the data based on the Kth attribute and print the final resulting table. Follow the example given below for better understanding. Note: If two attributes are the same..
2023.10.01 -
Prepare > Python > Built-Ins > Any or All
Any or All | HackerRank Return True, if any of the iterable is true or if all of it is true using the any() and all() expressions. www.hackerrank.com 문제 Task You are given a space separated list of integers. If all the integers are positive, then you need to check if any integer is a palindromic integer. Input Format The first line contains an integer N. N is the total number of integers in the ..
2023.09.29