SlideShare a Scribd company logo
1 of 1
Download to read offline
Java Program:
import java.io.*;
import java.util.*;
public class LongestStreak {
public static int[] longestStreak(boolean[] values)
{
int max=0,index=0,mIndex=0;
for(int i=0;i
Solution
Java Program:
import java.io.*;
import java.util.*;
public class LongestStreak {
public static int[] longestStreak(boolean[] values)
{
int max=0,index=0,mIndex=0;
for(int i=0;i

More Related Content

More from anjanaarts2014

HClO3 + NaOH NaClO3 +H2O n(HClO3) = 0.10.04 = 4.pdf
                     HClO3 + NaOH  NaClO3 +H2O n(HClO3) = 0.10.04 = 4.pdf                     HClO3 + NaOH  NaClO3 +H2O n(HClO3) = 0.10.04 = 4.pdf
HClO3 + NaOH NaClO3 +H2O n(HClO3) = 0.10.04 = 4.pdfanjanaarts2014
 
I have already answered it. Check. .pdf
                     I have already answered it. Check.               .pdf                     I have already answered it. Check.               .pdf
I have already answered it. Check. .pdfanjanaarts2014
 
Iodide is a strong nucleophile but a weak base, s.pdf
                     Iodide is a strong nucleophile but a weak base, s.pdf                     Iodide is a strong nucleophile but a weak base, s.pdf
Iodide is a strong nucleophile but a weak base, s.pdfanjanaarts2014
 
NaCl Its the coulombic interaction between Na.pdf
                     NaCl  Its the coulombic interaction between Na.pdf                     NaCl  Its the coulombic interaction between Na.pdf
NaCl Its the coulombic interaction between Na.pdfanjanaarts2014
 
Here Jupiter is the fifth planet from the Sun a.pdf
                     Here  Jupiter is the fifth planet from the Sun a.pdf                     Here  Jupiter is the fifth planet from the Sun a.pdf
Here Jupiter is the fifth planet from the Sun a.pdfanjanaarts2014
 
moles of H+ = 42.0 x 0.120 millimoles = 5.04 mill.pdf
                     moles of H+ = 42.0 x 0.120 millimoles = 5.04 mill.pdf                     moles of H+ = 42.0 x 0.120 millimoles = 5.04 mill.pdf
moles of H+ = 42.0 x 0.120 millimoles = 5.04 mill.pdfanjanaarts2014
 
Lithium is group 1 metal, while nitrogen is group.pdf
                     Lithium is group 1 metal, while nitrogen is group.pdf                     Lithium is group 1 metal, while nitrogen is group.pdf
Lithium is group 1 metal, while nitrogen is group.pdfanjanaarts2014
 
there is some special character in ur question li.pdf
                     there is some special character in ur question li.pdf                     there is some special character in ur question li.pdf
there is some special character in ur question li.pdfanjanaarts2014
 
a.Times Interest Earned Ratio = EBIT interest ExpenseFor 2014.pdf
a.Times Interest Earned Ratio = EBIT  interest ExpenseFor 2014.pdfa.Times Interest Earned Ratio = EBIT  interest ExpenseFor 2014.pdf
a.Times Interest Earned Ratio = EBIT interest ExpenseFor 2014.pdfanjanaarts2014
 
45 yrs.Solution45 yrs..pdf
45 yrs.Solution45 yrs..pdf45 yrs.Solution45 yrs..pdf
45 yrs.Solution45 yrs..pdfanjanaarts2014
 
the bacteria isolated from the dead mouse is smooth (S) S. pneumonia.pdf
the bacteria isolated from the dead mouse is smooth (S) S. pneumonia.pdfthe bacteria isolated from the dead mouse is smooth (S) S. pneumonia.pdf
the bacteria isolated from the dead mouse is smooth (S) S. pneumonia.pdfanjanaarts2014
 
ANSWER A for example fluoride, oxide.... etc. .pdf
                     ANSWER A for example fluoride, oxide.... etc.  .pdf                     ANSWER A for example fluoride, oxide.... etc.  .pdf
ANSWER A for example fluoride, oxide.... etc. .pdfanjanaarts2014
 
H2SO4 = 2H+ + SO42-[H+] = 2[H2SO4] = 0.0092 MpH = -log[H+] = 2..pdf
H2SO4 = 2H+ + SO42-[H+] = 2[H2SO4] = 0.0092 MpH = -log[H+] = 2..pdfH2SO4 = 2H+ + SO42-[H+] = 2[H2SO4] = 0.0092 MpH = -log[H+] = 2..pdf
H2SO4 = 2H+ + SO42-[H+] = 2[H2SO4] = 0.0092 MpH = -log[H+] = 2..pdfanjanaarts2014
 
here reaction is occurring when Sn and I2 are refluxed together redu.pdf
here reaction is occurring when Sn and I2 are refluxed together redu.pdfhere reaction is occurring when Sn and I2 are refluxed together redu.pdf
here reaction is occurring when Sn and I2 are refluxed together redu.pdfanjanaarts2014
 
An undirected graph is acyclic (i.e., a forest) iff a DFS yields no .pdf
An undirected graph is acyclic (i.e., a forest) iff a DFS yields no .pdfAn undirected graph is acyclic (i.e., a forest) iff a DFS yields no .pdf
An undirected graph is acyclic (i.e., a forest) iff a DFS yields no .pdfanjanaarts2014
 
A) [Sn2+]^3 [Fe3+]^2 (dont include solids) B).pdf
                     A) [Sn2+]^3  [Fe3+]^2 (dont include solids) B).pdf                     A) [Sn2+]^3  [Fe3+]^2 (dont include solids) B).pdf
A) [Sn2+]^3 [Fe3+]^2 (dont include solids) B).pdfanjanaarts2014
 
GivenLOSS Sells a variety of equpiment including the executive off.pdf
GivenLOSS Sells a variety of equpiment including the executive off.pdfGivenLOSS Sells a variety of equpiment including the executive off.pdf
GivenLOSS Sells a variety of equpiment including the executive off.pdfanjanaarts2014
 
Answer for question 1DuPont analysis explains what is affecting co.pdf
Answer for question 1DuPont analysis explains what is affecting co.pdfAnswer for question 1DuPont analysis explains what is affecting co.pdf
Answer for question 1DuPont analysis explains what is affecting co.pdfanjanaarts2014
 

More from anjanaarts2014 (20)

HClO3 + NaOH NaClO3 +H2O n(HClO3) = 0.10.04 = 4.pdf
                     HClO3 + NaOH  NaClO3 +H2O n(HClO3) = 0.10.04 = 4.pdf                     HClO3 + NaOH  NaClO3 +H2O n(HClO3) = 0.10.04 = 4.pdf
HClO3 + NaOH NaClO3 +H2O n(HClO3) = 0.10.04 = 4.pdf
 
The -OCl ion. .pdf
                     The -OCl ion.                                    .pdf                     The -OCl ion.                                    .pdf
The -OCl ion. .pdf
 
I have already answered it. Check. .pdf
                     I have already answered it. Check.               .pdf                     I have already answered it. Check.               .pdf
I have already answered it. Check. .pdf
 
Iodide is a strong nucleophile but a weak base, s.pdf
                     Iodide is a strong nucleophile but a weak base, s.pdf                     Iodide is a strong nucleophile but a weak base, s.pdf
Iodide is a strong nucleophile but a weak base, s.pdf
 
NaCl Its the coulombic interaction between Na.pdf
                     NaCl  Its the coulombic interaction between Na.pdf                     NaCl  Its the coulombic interaction between Na.pdf
NaCl Its the coulombic interaction between Na.pdf
 
Here Jupiter is the fifth planet from the Sun a.pdf
                     Here  Jupiter is the fifth planet from the Sun a.pdf                     Here  Jupiter is the fifth planet from the Sun a.pdf
Here Jupiter is the fifth planet from the Sun a.pdf
 
moles of H+ = 42.0 x 0.120 millimoles = 5.04 mill.pdf
                     moles of H+ = 42.0 x 0.120 millimoles = 5.04 mill.pdf                     moles of H+ = 42.0 x 0.120 millimoles = 5.04 mill.pdf
moles of H+ = 42.0 x 0.120 millimoles = 5.04 mill.pdf
 
Lithium is group 1 metal, while nitrogen is group.pdf
                     Lithium is group 1 metal, while nitrogen is group.pdf                     Lithium is group 1 metal, while nitrogen is group.pdf
Lithium is group 1 metal, while nitrogen is group.pdf
 
there is some special character in ur question li.pdf
                     there is some special character in ur question li.pdf                     there is some special character in ur question li.pdf
there is some special character in ur question li.pdf
 
a.Times Interest Earned Ratio = EBIT interest ExpenseFor 2014.pdf
a.Times Interest Earned Ratio = EBIT  interest ExpenseFor 2014.pdfa.Times Interest Earned Ratio = EBIT  interest ExpenseFor 2014.pdf
a.Times Interest Earned Ratio = EBIT interest ExpenseFor 2014.pdf
 
45 yrs.Solution45 yrs..pdf
45 yrs.Solution45 yrs..pdf45 yrs.Solution45 yrs..pdf
45 yrs.Solution45 yrs..pdf
 
the bacteria isolated from the dead mouse is smooth (S) S. pneumonia.pdf
the bacteria isolated from the dead mouse is smooth (S) S. pneumonia.pdfthe bacteria isolated from the dead mouse is smooth (S) S. pneumonia.pdf
the bacteria isolated from the dead mouse is smooth (S) S. pneumonia.pdf
 
ANSWER A for example fluoride, oxide.... etc. .pdf
                     ANSWER A for example fluoride, oxide.... etc.  .pdf                     ANSWER A for example fluoride, oxide.... etc.  .pdf
ANSWER A for example fluoride, oxide.... etc. .pdf
 
H2SO4 = 2H+ + SO42-[H+] = 2[H2SO4] = 0.0092 MpH = -log[H+] = 2..pdf
H2SO4 = 2H+ + SO42-[H+] = 2[H2SO4] = 0.0092 MpH = -log[H+] = 2..pdfH2SO4 = 2H+ + SO42-[H+] = 2[H2SO4] = 0.0092 MpH = -log[H+] = 2..pdf
H2SO4 = 2H+ + SO42-[H+] = 2[H2SO4] = 0.0092 MpH = -log[H+] = 2..pdf
 
here reaction is occurring when Sn and I2 are refluxed together redu.pdf
here reaction is occurring when Sn and I2 are refluxed together redu.pdfhere reaction is occurring when Sn and I2 are refluxed together redu.pdf
here reaction is occurring when Sn and I2 are refluxed together redu.pdf
 
An undirected graph is acyclic (i.e., a forest) iff a DFS yields no .pdf
An undirected graph is acyclic (i.e., a forest) iff a DFS yields no .pdfAn undirected graph is acyclic (i.e., a forest) iff a DFS yields no .pdf
An undirected graph is acyclic (i.e., a forest) iff a DFS yields no .pdf
 
A) [Sn2+]^3 [Fe3+]^2 (dont include solids) B).pdf
                     A) [Sn2+]^3  [Fe3+]^2 (dont include solids) B).pdf                     A) [Sn2+]^3  [Fe3+]^2 (dont include solids) B).pdf
A) [Sn2+]^3 [Fe3+]^2 (dont include solids) B).pdf
 
GivenLOSS Sells a variety of equpiment including the executive off.pdf
GivenLOSS Sells a variety of equpiment including the executive off.pdfGivenLOSS Sells a variety of equpiment including the executive off.pdf
GivenLOSS Sells a variety of equpiment including the executive off.pdf
 
Answer for question 1DuPont analysis explains what is affecting co.pdf
Answer for question 1DuPont analysis explains what is affecting co.pdfAnswer for question 1DuPont analysis explains what is affecting co.pdf
Answer for question 1DuPont analysis explains what is affecting co.pdf
 
3360Solution3360.pdf
3360Solution3360.pdf3360Solution3360.pdf
3360Solution3360.pdf
 

Recently uploaded

e-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopale-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi RajagopalEADTU
 
8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital ManagementMBA Assignment Experts
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...Nguyen Thanh Tu Collection
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...Nguyen Thanh Tu Collection
 
demyelinated disorder: multiple sclerosis.pptx
demyelinated disorder: multiple sclerosis.pptxdemyelinated disorder: multiple sclerosis.pptx
demyelinated disorder: multiple sclerosis.pptxMohamed Rizk Khodair
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code ExamplesPeter Brusilovsky
 
An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppCeline George
 
Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesAmanpreetKaur157993
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...Nguyen Thanh Tu Collection
 
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportBasic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportDenish Jangid
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project researchCaitlinCummins3
 
UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024Borja Sotomayor
 
Scopus Indexed Journals 2024 - ISCOPUS Publications
Scopus Indexed Journals 2024 - ISCOPUS PublicationsScopus Indexed Journals 2024 - ISCOPUS Publications
Scopus Indexed Journals 2024 - ISCOPUS PublicationsISCOPE Publication
 
MOOD STABLIZERS DRUGS.pptx
MOOD     STABLIZERS           DRUGS.pptxMOOD     STABLIZERS           DRUGS.pptx
MOOD STABLIZERS DRUGS.pptxPoojaSen20
 
Climbers and Creepers used in landscaping
Climbers and Creepers used in landscapingClimbers and Creepers used in landscaping
Climbers and Creepers used in landscapingDr. M. Kumaresan Hort.
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...EduSkills OECD
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxneillewis46
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxMarlene Maheu
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17Celine George
 

Recently uploaded (20)

OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
e-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopale-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopal
 
8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
demyelinated disorder: multiple sclerosis.pptx
demyelinated disorder: multiple sclerosis.pptxdemyelinated disorder: multiple sclerosis.pptx
demyelinated disorder: multiple sclerosis.pptx
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
 
An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge App
 
Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategies
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
 
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportBasic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
 
UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024
 
Scopus Indexed Journals 2024 - ISCOPUS Publications
Scopus Indexed Journals 2024 - ISCOPUS PublicationsScopus Indexed Journals 2024 - ISCOPUS Publications
Scopus Indexed Journals 2024 - ISCOPUS Publications
 
MOOD STABLIZERS DRUGS.pptx
MOOD     STABLIZERS           DRUGS.pptxMOOD     STABLIZERS           DRUGS.pptx
MOOD STABLIZERS DRUGS.pptx
 
Climbers and Creepers used in landscaping
Climbers and Creepers used in landscapingClimbers and Creepers used in landscaping
Climbers and Creepers used in landscaping
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptx
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptx
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17
 

Java Program import java.io.; import java.util.;public cl.pdf

  • 1. Java Program: import java.io.*; import java.util.*; public class LongestStreak { public static int[] longestStreak(boolean[] values) { int max=0,index=0,mIndex=0; for(int i=0;i Solution Java Program: import java.io.*; import java.util.*; public class LongestStreak { public static int[] longestStreak(boolean[] values) { int max=0,index=0,mIndex=0; for(int i=0;i