# 410 Split Array Largest Sum

### Problem

Given an array which consists of non-negative integers and an integer m, you can split the array into m non-empty continuous subarrays. Write an algorithm to minimize the largest sum among these m subarrays.

Note: If n is the length of array, assume the following constraints are satisfied:

1 ≤ n ≤ 1000 1 ≤ m ≤ min(50, n) Examples:

``````Input:
nums = [7,2,5,10,8]
m = 2

Output:
18

Explanation:
There are four ways to split nums into two subarrays.
The best way is to split it into [7,2,5] and [10,8],
where the largest sum among the two subarrays is only 18.
``````
{"ft_lang_label":"__label__en","ft_lang_prob":0.81500006,"math_prob":0.97849286,"size":590,"snap":"2022-05-2022-21","text_gpt3_token_len":159,"char_repetition_ratio":0.13139932,"word_repetition_ratio":0.0,"special_character_ratio":0.29152542,"punctuation_ratio":0.15789473,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99533075,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-05-19T15:14:10Z\",\"WARC-Record-ID\":\"<urn:uuid:4d4c3ebc-3d6c-4955-a0bb-6d27232bd79d>\",\"Content-Length\":\"174791\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:5bdf1d80-2d52-4eb1-b769-41743f6e6c27>\",\"WARC-Concurrent-To\":\"<urn:uuid:11b2fee2-44f5-48ce-ab58-03fe5addf78c>\",\"WARC-IP-Address\":\"104.18.2.206\",\"WARC-Target-URI\":\"https://cheonhyangzhang.gitbooks.io/leetcode-solutions/content/410-split-array-largest-sum.html\",\"WARC-Payload-Digest\":\"sha1:VHM3GTYQFZRUFBT3QTHAUYQP5GCUZEA2\",\"WARC-Block-Digest\":\"sha1:ZNJI57JLWPHIWSHNHT5GCMQABGMJJWTW\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-21/CC-MAIN-2022-21_segments_1652662529538.2_warc_CC-MAIN-20220519141152-20220519171152-00564.warc.gz\"}"}