30 Day code challenge-python

--

Day 21 — Generics

Task

Write a single generic function named printArray; this function must take an array of generic elements as a parameter (the exception to this is C++, which takes a vector).

Input Format

The locked Solution class in your editor will pass different types of arrays to your printArray function.

Output Format

printArray function should print each element of its generic array parameter on a new line.

Solution

Explanation

This problem can’t be solved using python. So here C++ is used instead. I don’t have basic understanding of C++ language. I have copied this code solution from https://www.programmingwithbasics.com/

See you on day 22

--

--

No responses yet