Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
给定一个数组并将它们分组为可能的总和。
仅输入此数组:[1,2,3,4,5] 输出:{[5,1] [4,2]} {[3,2] [4,1]}
有没有办法在不使用for循环嵌套的情况下解决这个问题?