HackerRank-Python(90)
-
Prepare > Python > Numpy > Concatenate
Concatenate | HackerRank Use the concatenate function on 2 arrays. www.hackerrank.com 문제 Task You are given two integer arrays of size N X P and M X P (N & M are rows, and P is the column). Your task is to concatenate the arrays along axis 0. Input Format The first line contains space separated integers N,M and P. The next N lines contains the space separated elements of the P columns. After tha..
2023.08.29 -
Prepare > Python > Numpy > Transpose and Flatten
Transpose and Flatten | HackerRank Use the transpose and flatten tools in the NumPy module to manipulate an array. www.hackerrank.com 문제 Task You are given a NXM integer array matrix with space separated elements ( N= rows and M= columns). Your task is to print the transpose and flatten results. Input Format The first line contains the space separated values of N and M. The next N lines contains..
2023.08.28 -
Prepare > Python > Numpy > Shape and Reshape
Shape and Reshape | HackerRank Using the shape and reshape tools available in the NumPy module, configure a list according to the guidelines. www.hackerrank.com 문제 Task You are given a space separated list of nine integers. Your task is to convert this list into a 3X3 NumPy array. Input Format A single line of input containing 9 space separated integers. Output Format Print the 3X3 NumPy array. ..
2023.08.27 -
Prepare > Python > Numpy > Arrays
Arrays | HackerRank Convert a list to an array using the NumPy package. www.hackerrank.com 문제 Task You are given a space separated list of numbers. Your task is to print a reversed NumPy array with the element type float. Input Format A single line of input containing space separated numbers. Output Format Print the reverse NumPy array with type float. => 숫자들을 인풋해줄건데, 역순으로 numpy.array에 담아 소수형으로 ..
2023.08.26 -
Prepare > Python > Python Functionals > Map and Lambda Function
Map and Lambda Function | HackerRank This challenge covers the basic concept of maps and lambda expressions. www.hackerrank.com 문제 Input Format One line of input: an integer N. output Format A list on a single line containing the cubes of the first N fibonacci numbers. => 정수 N을 줄건데 피보나치 수열의 첫 N개의 세제곱 값을 리스트에 담아라 코드 cube = lambda x: x ** 3 # complete the lambda function def fibonacci(n): # return..
2023.08.25 -
Prepare > Python > Errors and Exceptions > Incorrect Regex
Incorrect Regex | HackerRank Check whether the regex is valid or not. www.hackerrank.com 문제 You are given a string S. Your task is to find out whether S is a valid regex or not. Input Format The first line contains integer T, the number of test cases. The next T lines contains the string S. Output Format Print "True" or "False" for each test case without quotes. => 문자열S를 T개 줄건데 각각이 유효한 정규표현식인지 T..
2023.08.24 -
Prepare > Python > Errors and Exceptions > Exceptions
Exceptions | HackerRank Handle errors detected during execution. www.hackerrank.com 문제 Task You are given two values a and b. Perform integer division and print a/b. Input Format The first line contains T, the number of test cases. The next T lines each contain the space separated values of a and b. Output Format Print the value of . In the case of ZeroDivisionError or ValueError, print the erro..
2023.08.22