Pattern of string | Python Programming

Python program pattern of string

Given a string S of length N, find the pattern of the strings as shown below in the examples.

Example 1:

Input: S = "GeeK"
Output: Geek
        Gee
        Ge
        G
Explanation: Decrease one character 
after each line

Example 2:

Input: S = "G*g" 
Output: G*g
        G*
        G
Explanation: Decrease one character
after each line
Pattern of Strings Python Program

Solution : Replit

For more updates : Algothink

Previous
Previous

LCM of two Numbers | Python Programming

Next
Next

Remove the vowels from the string