You've successfully subscribed to The Poor Coder | Hackerrank Solutions
Great! Next, complete checkout for full access to The Poor Coder | Hackerrank Solutions
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.
Hackerrank Zeros and Ones Solution

Hackerrank Zeros and Ones Solution

Beeze Aal
Beeze Aal

Solution in python3

Approach 1.

import numpy
N = list(map(int, input().split()))
print(numpy.zeros(N, int))
print(numpy.ones(N, int))

Approach 2.

import numpy
size = tuple(map(int,input().strip().split()))
print( numpy.zeros(size, int) )
print( numpy.ones(size, int) )

Approach 3.

import numpy
N = [int(x) for x in input().split()]
print(numpy.zeros(N, dtype = numpy.int))
print(numpy.ones(N, dtype = numpy.int))

Solution in python

import numpy
N=map(int,raw_input().split())
print numpy.zeros(N,dtype = numpy.int)
print numpy.ones(N,dtype = numpy.int)