DugarRishab / Algo.io

From solutions of Leet code in various languages to list of important algorithms for developers, we have everything
7 stars 40 forks source link

Create Q06_Zigzag_Conversion.py #73

Closed RP2025 closed 1 year ago

RP2025 commented 1 year ago

Here I am using Brute force approach including dynamic programming #If the number of rows in pattern is given 1 then it means that the string itself is correct and now the further pattern is needed to be resolved #if the number of rows is not equal to one and greater than 1 then we are resolving the pattern using brute force and it will make a new list and append the characters at the required indexes and return the correct list as a string

This is a template on how to fill out a PR properly.

Description

The question gives a string in a zigzag pattern and we are asked to decode to get the correct string

Here I am using Brute force approach including dynamic programming

If the number of rows in pattern is given 1 then it means that the string itself is correct and now the further pattern is needed to be resolved

if the number of rows is not equal to one and greater than 1 then we are resolving the pattern using brute force and it will make a new list and append the characters at the required indexes and return the correct list as a string

Related Issue

Acceptance Criteria

Type of Changes

Type
:bug: Bug fix
:sparkles: New feature
:hammer: Refactoring
:100: Add tests
:link: Update dependencies
:scroll: Docs

Testing Steps / QA Criteria

Q06_Zigzag_Conversion_accepted