Upcoming technologies, programming, problem solving, coding, technology, mobile phones
About us
Get link
Facebook
X
Pinterest
Email
Other Apps
In this blog you will be able to learn python-programming language and problem solving. You can also find solutions for hackerrank problems, google coding problems.
Solution for hackerRank problems What's your name, Tuple in Python. 1. What's your name You are given the first name and lastname of a person on two different lines. Your task is to read them and print the following: "Hello firstname lastname! You just delved into python." Function Description Complete the print_full_name function in the editor below. print_full_name has the following parameters: string first: the first name string last: the last name Prints string: 'Hello firstname lastname! You just delved into python' where firstname and lastname are replaced with first and last. Input Format The first line contains the first name, and the second line contains the last name. Constraints The length of the first and last names are each ≤ . Sample Input 0 Ross Taylor Sample Output 0 Hello Ross Taylor! You just delved into python. Explanation 0 The input read by the program is stored as a string data type. A string is a collection of c...
Solution for hackerRank problem Sparse Arrays in C Problem : There is a collection of input strings and a collection of query strings. For each query string, determine how many times it occurs in the list of input strings. Return an array of the results. Example, stringList = [ 'ab', 'ab' , 'abc' ] queries = [ 'ab' , 'abc' , 'bc' ] There are 2 instances of 'ab', 1 of 'abc' and 0 of 'bc'. For each query, add an element to the return array, results = [2,1,0]. Function Description Complete the function matchingStrings in the editor below. The function must return an array of integers representing the frequency of occurrence of each query string in stringList. matchingStrings has the following parameters: string stringList[n] - an array of strings to search string queries[q] - an array of query strings Returns int[q]: an array of results for each query Input Format The first line contains and integer n, the ...
Solution for hackerRank problem Arrays-DS in Python Problem : An array is a type of data structure that stores elements of the same type in a contiguous block of memory. In an array, A , of size N, each memory location has some unique index, i(where 0 <= i < N), that can be referenced as A[i] or Ai. Reverse an array of integers. Note: If you've already solved our C++ domain's Arrays Introduction challenge, you may want to skip this. Example A = [1, 2, 3] Return [3, 2, 1]. Function Description Complete the function reverseArray in the editor below. reverseArray has the following parameter(s): int A[n]: the array to reverse Returns int[n]: the reversed array Input Format The first line contains an integer, N, the number of integers in A. The second line contains N space-separated integers that make up A. Constraints 1 <= N <= 10^3 1 <= A[i] <= 10^4, where A[i] is the ith integer in A Sample Input 1 Sample Output 1 2 3 4 1 Code : #!/bin/python3 import math impor...
Comments
Post a Comment