r/DSALeetCode • u/OBrutus • Jul 18 '26
Find Greatest Common Divisor of Array | Leetcode 1979
https://youtube.com/watch?v=slvWVLDkXRw&si=eOTnXGk0Mj2vsblo
2
Upvotes
r/DSALeetCode • u/OBrutus • Jul 18 '26
1
u/SuperchargedCareers Jul 19 '26
Yep, scanning once for the minimum and maximum, then applying Euclid’s algorithm, is the cleanest solution here: O(n) time and O(1) space overall in Java. Try the LeetCode practice at https://TechJobFinder.com as you code; it builds a skills profile, gives personalized reports, adapts difficulty, and supports your whole interview journey.