mercredi 23 juin 2021

I want to know the algorithm for solving this pattern problem? I am using python language for it [closed]

Given a positive integer 'n' less than or equal to 26, you are required to print the below pattern

Sample Input: 5

Sample Output :

--------e-------- 
------e-d-e------ 
----e-d-c-d-e---- 
--e-d-c-b-c-d-e-- 
e-d-c-b-a-b-c-d-e 
--e-d-c-b-c-d-e-- 
----e-d-c-d-e---- 
------e-d-e------ 
--------e-------- 

Sample Input : 3

Sample Output :

----c---- 
--c-b-c-- 
c-b-a-b-c 
--c-b-c-- 
----c----

Aucun commentaire:

Enregistrer un commentaire