All Tracks Data Structures Arrays 1-D Problem

Monk and Welcome Problem
Tag(s):

Data Structures, Very-Easy

Problem
Editorial
Analytics

Having a good previous year, Monk is back to teach algorithms and data structures. This year he welcomes the learners with a problem which he calls "Welcome Problem". The problem gives you two arrays A and B (each array of size N) and asks to print new array C such that:
\(C[i]=A[i]+B[i]\) ; \(1 \le i \le N\)
Now, Monk will proceed further when you solve this one. So, go on and solve it :)

Input:
First line consists of an integer N, denoting the size of A and B.
Next line consists of N space separated integers denoting the array A.
Next line consists of N space separated integers denoting the array B.

Output:
Print N space separated integers denoting the array C.

Input Constraints:
\(1 \le N \le 100000\)
\(1 \le A[i] \le 100000\); \(1 \le i \le N\)
\(1 \le B[i] \le 100000\); \(1 \le i \le N\)

SAMPLE INPUT
5
1 2 3 4 5
4 5 3 2 10
SAMPLE OUTPUT
5 7 6 6 15 
Explanation

The output array is the addition of input arrays A and B.

Time Limit: 1.0 sec(s) for each input file.
Memory Limit: 256 MB
Source Limit: 1024 KB
Marking Scheme: Marks are awarded when all the testcases pass.
Allowed Languages: C, C++, C++14, Clojure, C#, D, Erlang, F#, Go, Groovy, Haskell, Java, Java 8, JavaScript(Rhino), JavaScript(Node.js), Julia, Kotlin, Lisp, Lisp (SBCL), Lua, Objective-C, OCaml, Octave, Pascal, Perl, PHP, Python, Python 3, R(RScript), Racket, Ruby, Rust, Scala, Swift, Visual Basic

CODE EDITOR

Initializing Code Editor...
Your Rating:

Contributor

This Problem was Asked in

HackerEarth

Challenge Name

CodeMonk (Arrays & Strings)

OTHER PROBLEMS OF THIS CHALLENGE
Notifications
View All Notifications

?