Range GCD Queries
Medium
Sparse Table & RMQ
Given an array, answer q queries for the greatest common divisor of nums[l..r] (0-indexed, inclusive).
Constraints
1 <= n, q <= 10^5 1 <= nums[i] <= 10^9
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.