SlideShare a Scribd company logo
1 of 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]

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-.docxCharlesCSZWhitei
 
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.docxCharlesCSZWhitei
 
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.docxCharlesCSZWhitei
 
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.docxCharlesCSZWhitei
 
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.docxCharlesCSZWhitei
 
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.docxCharlesCSZWhitei
 
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.docxCharlesCSZWhitei
 
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.docxCharlesCSZWhitei
 
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.docxCharlesCSZWhitei
 
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.docxCharlesCSZWhitei
 
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).docxCharlesCSZWhitei
 
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.docxCharlesCSZWhitei
 
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.docxCharlesCSZWhitei
 
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.docxCharlesCSZWhitei
 
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.docxCharlesCSZWhitei
 

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

How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 

Recently uploaded (20)

How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 

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]