HackerRank Inner and Outer problem solution in Python YASH PAL, 31 July 202417 January 2026 HackerRank Inner and Outer problem solution in Python – In this Inner and Outer problem in Python programming, you are given two arrays: A and B. Your task is to compute their inner and outer product.innerThe inner tool returns the inner product of two arrays.import numpy A = numpy.array([0, 1]) B = numpy.array([3, 4]) print numpy.inner(A, B) #Output : 4 outerThe outer tool returns the outer product of two arrays.import numpy A = numpy.array([0, 1]) B = numpy.array([3, 4]) print numpy.outer(A, B) #Output : [[0 0] # [3 4]]HackerRank Inner and Outer problem solution in Python 2.import numpy m=numpy.array(map(int,raw_input().split())) n=numpy.array(map(int,raw_input().split())) print numpy.inner(m,n) print numpy.outer(m,n)Inner and Outer Solution in Python 3.import numpy as npA = np.array(input().split(), int)B = np.array(input().split(), int)print(np.inner(A,B), np.outer(A,B), sep='n')Problem solution in pypy programming.# Enter your code here. Read input from STDIN. Print output to STDOUT import numpy as np A = np.array([int(i) for i in raw_input().split()]) B = np.array([int(i) for i in raw_input().split()]) print np.inner(A, B) print np.outer(A, B)Problem solution in pypy3 programming.# Enter your code here. Read input from STDIN. Print output to STDOUT import numpy as np a = [int(i) for i in input().split()] b = [int(i) for i in input().split()] print(np.inner(a,b)) print(np.outer(a,b)) coding problems solutions Hackerrank Problems Solutions Python Solutions HackerRankPython