先考虑无解的情况:当n为奇数时无解 相邻的两个元素一定可以变成0 a [ i ] ! = a [ i + 1 ] 时,分成 [ i , i ] , 和 [ i + 1 , i + 1 ] a[i] != a[i + 1]时, 分成[i, i], 和[i + 1, i + 1] a[i]!=a[i+1]时,分成[i,i],和[i+1,i+1] a [ i ] = a [ i + 1 ] 时,分成
The description of the problem Given an integer n, return the number of ways you can write n as the sum of consecutive positive integers.来源:力扣(LeetCode)链接:https://leetcode.cn/problems/consecutive-nu