How to GCD in Groovy - Code Snippet

How to perform 'GCD' in Groovy.

example.groovy
// Task: GCD
// Language: Groovy

def gcd() {
    // Implementation for GCD
    def result = ...; // Initialize variable
    // TODO: Implement core logic here
    // Step 1: Prepare data
    // Step 2: Process GCD
    println("Done");
}
AdSense Slot