How to solve this (DSA problem) Positive Prefixes?

后端 未结 0 1494
旧巷少年郎
旧巷少年郎 2020-12-05 17:39

You are given two positive integers N and K, where K≤N. Find a sequence A1,A2,…,An such that:

  • for each valid i, Ai is either i or −i
  • there are exactly
相关标签:
回答
  • 消灭零回复
提交回复
热议问题