/**
 * This function takes a farmer's name and a crop name as input. It returns a string slicing pattern
 * that the farmer needs to follow in order to harvest the crop effectively.
 *
 * @param farmer The name of the farmer.
 * @param crop The name of the crop.
 * @return The string slicing pattern for effective crop harvest.
 */
fun cropHarvest(farmer: String, crop: String): String {

    var pattern = ""

    // Check if the crop name is longer than the farmer's name
    if (crop.length > farmer.length) {
        // Slice the crop name using the step parameter
        // Start from the first character and repeat the slicing pattern until the end
        for (i in farmer.indices) {
            pattern += crop.slice(i until crop.length step farmer.length)
        }
    } else {
        // Slice the crop name using the step parameter
        // Start from the last character and repeat the slicing pattern until the beginning
        for (i in crop.indices) {
            pattern += crop.slice((crop.length - i - 1) until crop.length step crop.length)
        }
    }

    return pattern
}
/**
 * This function takes a farmer's name and a crop name as input. It returns a string slicing pattern
 * that the farmer needs to follow in order to harvest the crop effectively.
 *
 * @param farmer The name of the farmer.
 * @param crop The name of the crop.
 * @return The string slicing pattern for effective crop harvest.
 */
fun cropHarvest(farmer: String, crop: String): String {
/**
 * This function takes a farmer's name and a crop name as input. It returns a string slicing pattern
 * that the farmer needs to follow in order to harvest the crop effectively.
 *
 * @param farmer The name of the farmer.
 * @param crop The name of the crop.
 * @return The string slicing pattern for effective crop harvest.
 */
fun cropHarvest(farmer: String, crop: String): String {

    var pattern = ""

    // Check if the crop name is longer than the farmer's name
    if (crop.length > farmer.length) {
        // Slice the crop name using the step parameter
        // Start from the first character and repeat the slicing pattern until the end
        for (i in farmer.indices) {
            pattern += crop.slice(i until crop.length step farmer.length)
        }
    } else {
        // Slice the crop name using the step parameter
        // Start from the last character and repeat the slicing pattern until the beginning
        for (i in crop.indices) {
            pattern += crop.slice((crop.length - i - 1) until crop.length step crop.length)
        }
    }

    return pattern
}