Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

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.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.