Skip to content

# Tag Archives: pattern-printing

Given a string, S of size N, and a number of rows R, the task is to print the given string in a vertical zigzag… Read More
Pascal’s triangle is a pattern of the triangle which is based on nCr, below is the pictorial representation of Pascal’s triangle. Example: Input: N =… Read More
Given a matrix arr[][] of dimensions N * M and an integer K, the task is to print all elements of the matrix starting from… Read More
Let us see how to print an inverted heart pattern in Python. Example: Input: 11 Output: * *** ***** ******* ********* *********** ************* *************** *****************… Read More
Given a number N, the task is to determine if it is possible to make Pascal’s triangle with a complete layer by using total number… Read More
Given an integer N, the task is to print the pattern below for the given value of N.   For N = 5, below is the… Read More
Given a number N, the task is to print the star pattern in single loop. Examples:  Input: N = 9 Output: * * * *… Read More
Given a positive integer N, the task is to print an N × N zig-zag matrix consisting of numbers from 1 to N2, such that… Read More
Given a number N, the task is to print the first N terms of the series 6, 28, 66, 120, 190, 276, and so on.Examples:… Read More
Given a non-negative integer N, the task is to find the Nth row of Pascal’s Triangle.  Note: The row index starts from 0.  Pascal’s Triangle: 1 1… Read More
Given a number N, the task is to generate the pyramid sequence pattern which contains N pyramids one after the other as shown in the… Read More
Give an integer N and the task is to print hollow half diamond pattern. Examples: Input : 6 Output : # # # # #… Read More
Given a number n, the task is to print ‘K’ using alphabets.Examples:  Input: n = 5 Output: A B C D E F A B… Read More
Given an integer N, the task is to print half-diamond-star pattern. * ** *** **** ***** ****** ***** **** *** ** * Examples: Input: N… Read More
Given an integer N, the task is to print the modified binary tree pattern.  In Modified Binary Triangle Pattern, the first and last element of… Read More