Returns the and of the largest interconnected subarray in a two-dimensional integer array

Source: Internet
Author: User

Topic:

Enter a two-dimensional shaping array with positive numbers in the array and a negative number.

The maximum value for the and of all sub-arrays.

Requirements:

The pair completes the programming task.

One person is mainly responsible for program analysis, code programming.

One person is responsible for code review and Code test plan.

Publish a blog post about design ideas, problems that arise, possible solutions (multiple choices), source code, results, summaries.

Thought:

After seeing this topic, think for a long time also did not think of a more satisfactory solution, think the topic is more difficult, beyond my ability range. However, the individual thinks that the knowledge of graph theory may be used, but the study is not good. It may be simpler to solve the maximum Unicom array based on a given two-dimensional array. Starting with a non-negative number, looking for the next non-negative number near it, the middle may need to add a negative node, when the sum of negative nodes is greater than two non-negative one of which is not added, otherwise added and Unicom is marked as a new non-negative number. Continue querying for non-negative numbers backwards until all non-negative numbers have been checked.

Returns the and of the largest interconnected subarray in a two-dimensional integer array

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.