Add Two Sparse Polynomials
Each polynomial is given as terms (coefficient exponent). Add them, drop terms whose coefficient becomes zero and print the terms in decreasing exponent. If the sum is zero, print "0 0".
Constraints
1 <= n, m <= 10^5
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.