SlideShare a Scribd company logo
Can you help me in to flat this without recursion i.e simple loops?
def fun(i, j, inp, dp):
if i >=j : return True # means we are cheking upper matrix.
if dp[i][j] != -1: return dp[i][j] # means already processed.
if inp[i] != inp[j]:
# means not matching ending chars
dp[i][j] = False
break
dp[i][j] = fun(i+1, j-1, inp, dp)
return dp[i][j]

More Related Content

More from CharlesCSZWhitei

c) OB is for evervone- Build an argument to support this statement-.docx
c) OB is for evervone- Build an argument to support this statement-.docxc) OB is for evervone- Build an argument to support this statement-.docx
c) OB is for evervone- Build an argument to support this statement-.docx
CharlesCSZWhitei
 
c++ please as fast as u can 1-The term mutator in the C++ Object Orien.docx
c++ please as fast as u can 1-The term mutator in the C++ Object Orien.docxc++ please as fast as u can 1-The term mutator in the C++ Object Orien.docx
c++ please as fast as u can 1-The term mutator in the C++ Object Orien.docx
CharlesCSZWhitei
 
c++ 1-The term mutator in the C++ Object Oriented Programming commonly.docx
c++ 1-The term mutator in the C++ Object Oriented Programming commonly.docxc++ 1-The term mutator in the C++ Object Oriented Programming commonly.docx
c++ 1-The term mutator in the C++ Object Oriented Programming commonly.docx
CharlesCSZWhitei
 
By joining these two tables using a COURSE RIGHT OUTER JOIN DEPARTMENT.docx
By joining these two tables using a COURSE RIGHT OUTER JOIN DEPARTMENT.docxBy joining these two tables using a COURSE RIGHT OUTER JOIN DEPARTMENT.docx
By joining these two tables using a COURSE RIGHT OUTER JOIN DEPARTMENT.docx
CharlesCSZWhitei
 
caldelsta the rebobiety of the folbowing x x x.docx
caldelsta the rebobiety of the folbowing x x x.docxcaldelsta the rebobiety of the folbowing x x x.docx
caldelsta the rebobiety of the folbowing x x x.docx
CharlesCSZWhitei
 
Calculate the payout ratio- earnings per share- and return on common s.docx
Calculate the payout ratio- earnings per share- and return on common s.docxCalculate the payout ratio- earnings per share- and return on common s.docx
Calculate the payout ratio- earnings per share- and return on common s.docx
CharlesCSZWhitei
 
Calculate the genotypes and genotypic proportions of a cross between A.docx
Calculate the genotypes and genotypic proportions of a cross between A.docxCalculate the genotypes and genotypic proportions of a cross between A.docx
Calculate the genotypes and genotypic proportions of a cross between A.docx
CharlesCSZWhitei
 
Business Philosophy- What is important to you in business- How will y.docx
Business Philosophy- What is important to you in business-  How will y.docxBusiness Philosophy- What is important to you in business-  How will y.docx
Business Philosophy- What is important to you in business- How will y.docx
CharlesCSZWhitei
 
Calculate the CFFA- Balance Sheet $150-000 20142015 20142015Cas.docx
Calculate the CFFA-     Balance Sheet $150-000    20142015 20142015Cas.docxCalculate the CFFA-     Balance Sheet $150-000    20142015 20142015Cas.docx
Calculate the CFFA- Balance Sheet $150-000 20142015 20142015Cas.docx
CharlesCSZWhitei
 
Cabell Products is a division of a major corporation- Last year the di.docx
Cabell Products is a division of a major corporation- Last year the di.docxCabell Products is a division of a major corporation- Last year the di.docx
Cabell Products is a division of a major corporation- Last year the di.docx
CharlesCSZWhitei
 
Business Ethics and White-Collar Crime Business Ethics There are many (2).docx
Business Ethics and White-Collar Crime Business Ethics There are many (2).docxBusiness Ethics and White-Collar Crime Business Ethics There are many (2).docx
Business Ethics and White-Collar Crime Business Ethics There are many (2).docx
CharlesCSZWhitei
 
Calculate following measures for companies for the fiscal years- Opera.docx
Calculate following measures for companies for the fiscal years- Opera.docxCalculate following measures for companies for the fiscal years- Opera.docx
Calculate following measures for companies for the fiscal years- Opera.docx
CharlesCSZWhitei
 
Cabana Cruise Line uses a combination of debt and equity to fund opera.docx
Cabana Cruise Line uses a combination of debt and equity to fund opera.docxCabana Cruise Line uses a combination of debt and equity to fund opera.docx
Cabana Cruise Line uses a combination of debt and equity to fund opera.docx
CharlesCSZWhitei
 
C++ Only Suppose you are implementing a linked list where you want t.docx
C++ Only   Suppose you are implementing a linked list where you want t.docxC++ Only   Suppose you are implementing a linked list where you want t.docx
C++ Only Suppose you are implementing a linked list where you want t.docx
CharlesCSZWhitei
 
C++ C++ C++ In Chapter 1- the class clockType was designed to implem.docx
C++ C++ C++   In Chapter 1- the class clockType was designed to implem.docxC++ C++ C++   In Chapter 1- the class clockType was designed to implem.docx
C++ C++ C++ In Chapter 1- the class clockType was designed to implem.docx
CharlesCSZWhitei
 

More from CharlesCSZWhitei (15)

c) OB is for evervone- Build an argument to support this statement-.docx
c) OB is for evervone- Build an argument to support this statement-.docxc) OB is for evervone- Build an argument to support this statement-.docx
c) OB is for evervone- Build an argument to support this statement-.docx
 
c++ please as fast as u can 1-The term mutator in the C++ Object Orien.docx
c++ please as fast as u can 1-The term mutator in the C++ Object Orien.docxc++ please as fast as u can 1-The term mutator in the C++ Object Orien.docx
c++ please as fast as u can 1-The term mutator in the C++ Object Orien.docx
 
c++ 1-The term mutator in the C++ Object Oriented Programming commonly.docx
c++ 1-The term mutator in the C++ Object Oriented Programming commonly.docxc++ 1-The term mutator in the C++ Object Oriented Programming commonly.docx
c++ 1-The term mutator in the C++ Object Oriented Programming commonly.docx
 
By joining these two tables using a COURSE RIGHT OUTER JOIN DEPARTMENT.docx
By joining these two tables using a COURSE RIGHT OUTER JOIN DEPARTMENT.docxBy joining these two tables using a COURSE RIGHT OUTER JOIN DEPARTMENT.docx
By joining these two tables using a COURSE RIGHT OUTER JOIN DEPARTMENT.docx
 
caldelsta the rebobiety of the folbowing x x x.docx
caldelsta the rebobiety of the folbowing x x x.docxcaldelsta the rebobiety of the folbowing x x x.docx
caldelsta the rebobiety of the folbowing x x x.docx
 
Calculate the payout ratio- earnings per share- and return on common s.docx
Calculate the payout ratio- earnings per share- and return on common s.docxCalculate the payout ratio- earnings per share- and return on common s.docx
Calculate the payout ratio- earnings per share- and return on common s.docx
 
Calculate the genotypes and genotypic proportions of a cross between A.docx
Calculate the genotypes and genotypic proportions of a cross between A.docxCalculate the genotypes and genotypic proportions of a cross between A.docx
Calculate the genotypes and genotypic proportions of a cross between A.docx
 
Business Philosophy- What is important to you in business- How will y.docx
Business Philosophy- What is important to you in business-  How will y.docxBusiness Philosophy- What is important to you in business-  How will y.docx
Business Philosophy- What is important to you in business- How will y.docx
 
Calculate the CFFA- Balance Sheet $150-000 20142015 20142015Cas.docx
Calculate the CFFA-     Balance Sheet $150-000    20142015 20142015Cas.docxCalculate the CFFA-     Balance Sheet $150-000    20142015 20142015Cas.docx
Calculate the CFFA- Balance Sheet $150-000 20142015 20142015Cas.docx
 
Cabell Products is a division of a major corporation- Last year the di.docx
Cabell Products is a division of a major corporation- Last year the di.docxCabell Products is a division of a major corporation- Last year the di.docx
Cabell Products is a division of a major corporation- Last year the di.docx
 
Business Ethics and White-Collar Crime Business Ethics There are many (2).docx
Business Ethics and White-Collar Crime Business Ethics There are many (2).docxBusiness Ethics and White-Collar Crime Business Ethics There are many (2).docx
Business Ethics and White-Collar Crime Business Ethics There are many (2).docx
 
Calculate following measures for companies for the fiscal years- Opera.docx
Calculate following measures for companies for the fiscal years- Opera.docxCalculate following measures for companies for the fiscal years- Opera.docx
Calculate following measures for companies for the fiscal years- Opera.docx
 
Cabana Cruise Line uses a combination of debt and equity to fund opera.docx
Cabana Cruise Line uses a combination of debt and equity to fund opera.docxCabana Cruise Line uses a combination of debt and equity to fund opera.docx
Cabana Cruise Line uses a combination of debt and equity to fund opera.docx
 
C++ Only Suppose you are implementing a linked list where you want t.docx
C++ Only   Suppose you are implementing a linked list where you want t.docxC++ Only   Suppose you are implementing a linked list where you want t.docx
C++ Only Suppose you are implementing a linked list where you want t.docx
 
C++ C++ C++ In Chapter 1- the class clockType was designed to implem.docx
C++ C++ C++   In Chapter 1- the class clockType was designed to implem.docxC++ C++ C++   In Chapter 1- the class clockType was designed to implem.docx
C++ C++ C++ In Chapter 1- the class clockType was designed to implem.docx
 

Recently uploaded

The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
Mohammed Sikander
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 

Recently uploaded (20)

The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 

Can you help me in to flat this without recursion i-e simple loops- d.docx

  • 1. Can you help me in to flat this without recursion i.e simple loops? def fun(i, j, inp, dp): if i >=j : return True # means we are cheking upper matrix. if dp[i][j] != -1: return dp[i][j] # means already processed. if inp[i] != inp[j]: # means not matching ending chars dp[i][j] = False break dp[i][j] = fun(i+1, j-1, inp, dp) return dp[i][j]