samedi 21 septembre 2019

Star pattern printing from upside of the base and downside of the base according to the values in array

I am unable to come up with a proper solution to this problem where array with positive and negative values is responsible for the pattern in the output.

This should look something like this.

Array=[2,3,1,-1,-2]

Pattern: * * * * * * * * *

Please find this image if your still unable to understand the problem.

Aucun commentaire:

Enregistrer un commentaire