Missing Digit Pattern

121
0
Home Programs Missing Digit Pattern

The program must accept an integer N as the input. The program must print the desired pattern as shown in the Example input/Output section.
Note: All the digits in N are non-zero digits.

Boundary Condition(s):
11 <= N < 10^4

Input Format:
The first line contains N..

Output Format:
The lines contain the desired pattern as shown in the Example Input/Output section.

Example Input/Output 1:
Input

651
Output
51 51 51 51 51 51
61 61 61 61 61
65

Example Input/Output 2:
Input

9845
Output
845 845 845 845 845 845 845 845 845
945 945 945 945 945 945 945 945
985 985 985 985
984 984 984 984 984

a=input().strip()
for i in range(len(a)):
	h=int(a[i])
	C=""
	if(i==0):
		c=a[i+1:]+" "
	else:
		c=a[:i]+a[i+1:]+" "
	print(c*h)
Hephzibai
WRITTEN BY

Hephzibai

Hephzibai is a driven third-year student at St. Joseph's Institute of Technology, specializing in Computer Science and Engineering. With a keen interest in data science and also in fullstack.
One of my greatest strengths lies in my programming skills, which I've honed through countless hours of practice and participation in coding challenges. Platforms like Skillrack, HackerRank, and others have been my playgrounds, where I've tackled a wide range of problems with creativity and determination.

Leave a Reply

Your email address will not be published. Required fields are marked *