Skip to content
Programmingoneonone
Programmingoneonone
  • Home
  • CS Subjects
    • IoT ? Internet of Things
    • Digital Communication
    • Human Values
  • Programming Tutorials
    • C Programming
    • Data structures and Algorithms
    • 100+ Java Programs
    • 100+ C Programs
  • HackerRank Solutions
    • HackerRank Algorithms Solutions
    • HackerRank C problems solutions
    • HackerRank C++ problems solutions
    • HackerRank Java problems solutions
    • HackerRank Python problems solutions
Programmingoneonone

HackerRank Inner and Outer problem solution in python

YASH PAL, 31 July 2024

In this Inner and Outer problem, You are given two arrays: A and B. Your task is to compute their inner and outer product.

HackerRank Inner and Outer solution in python

Problem solution in Python 2 programming.

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)

Problem solution in Python 3 programming.

import numpy as np
A = 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 Python Solutions

Post navigation

Previous post
Next post

Pages

  • About US
  • Contact US
  • Privacy Policy

Programing Practice

  • C Programs
  • java Programs

HackerRank Solutions

  • C
  • C++
  • Java
  • Python
  • Algorithm

Other

  • Leetcode Solutions
  • Interview Preparation

Programming Tutorials

  • DSA
  • C

CS Subjects

  • Digital Communication
  • Human Values
  • Internet Of Things
  • YouTube
  • LinkedIn
  • Facebook
  • Pinterest
  • Instagram
©2025 Programmingoneonone | WordPress Theme by SuperbThemes