×

# BYTES11 - Editorial

 0 Problem Description : Given an array of N integers we have to find the largest subarray with maximal gcd . Problem Type : Easy / Adhoc type Short Explanation : Let the maximal number in the array be " M " .We have to find the largest subarray with all its numbers being M . Detailed Explanation : We first have to see what the maximal gcd of the array can be . It can simply be found by traversing the array and finding the maximal number .To find the largest subarray with maximal gcd we simply have to find the largest subarray with all its numbers being the maximum number of the array . This can be done in O(n) by simply increasing the counter if maximum number found otherwise setting it to zero . In the end the maximum subarray is the answer . Complexity :O(n) Solution :https://ideone.com/ZVZsu3 Related Problems : asked 23 Mar '16, 18:00 6●1 accept rate: 0% 0★admin ♦♦ 19.7k●350●498●541
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported
• mathemetical formulas in Latex between \$ symbol

Question tags:

×15,629
×1,167
×934
×20

question asked: 23 Mar '16, 18:00

question was seen: 395 times

last updated: 24 Mar '16, 15:19