Solved LeetCode program · 578 of 1,000
#0805 · Split Array With Same Average
Original English source
Keep a shared numbers holding 1, 2, 3, 4, 5, 6, 7, and 8. Keep a shared count of 0. Keep a shared whole of 0. Set count to 8. Set whole to 36. Keep a shared possible of 0. Keep a shared last of the last position of numbers.
To pick from spot (a whole number) with chosen (a whole number) and total (a whole number). If possible is 1, return. If spot is more than last, If chosen is more than 0 and chosen is less than count and total times count is whole times chosen, set possible to 1. If spot is more than last, return. Pick from spot plus 1 with chosen plus 1 and total plus item spot of numbers. Pick from spot plus 1 with chosen and total.
Pick from 0 with 0 and 0. If possible is 1, show true, otherwise show false.
Expected stdout
true