/**
 * Given a list of strings, this function repeats each string a certain number of times
 * and then performs string slicing on each repeated string based on given indices.
 *
 * @param strings a list of strings (e.g. ['hello', 'world'])
 * @param start an integer representing the starting index for string slicing
 * @param stop an integer representing the stopping index for string slicing
 * @param step an integer representing the step size for string slicing
 * @return a list of sliced strings
 *
 * Example:
 * repeatAndSlice(listOf("hello", "world"), 1, 4, 2)
 * >> ['el', 'rl']
 */
fun repeatAndSlice(strings: List<String>, start: Int, stop: Int, step: Int): List<String> {

    val result = mutableListOf<String>()
    for (string in strings) {
        val repeatedString = string.repeat(3)  // Repeat each string thrice
        val slicedString = repeatedString.slice(start until stop step step)  // Perform string slicing with given indices
        result.add(slicedString)
    }
    return result
}
/**
 * Given a list of strings, this function repeats each string a certain number of times
 * and then performs string slicing on each repeated string based on given indices.
 *
 * @param strings a list of strings (e.g. ['hello', 'world'])
 * @param start an integer representing the starting index for string slicing
 * @param stop an integer representing the stopping index for string slicing
 * @param step an integer representing the step size for string slicing
 * @return a list of sliced strings
 *
 * Example:
 * repeatAndSlice(listOf("hello", "world"), 1, 4, 2)
 * >> ['el', 'rl']
 */
fun repeatAndSlice(strings: List<String>, start: Int, stop: Int, step: Int): List<String> {
/**
 * Given a list of strings, this function repeats each string a certain number of times
 * and then performs string slicing on each repeated string based on given indices.
 *
 * @param strings a list of strings (e.g. ['hello', 'world'])
 * @param start an integer representing the starting index for string slicing
 * @param stop an integer representing the stopping index for string slicing
 * @param step an integer representing the step size for string slicing
 * @return a list of sliced strings
 *
 * Example:
 * repeatAndSlice(listOf("hello", "world"), 1, 4, 2)
 * >> ['el', 'rl']
 */
fun repeatAndSlice(strings: List<String>, start: Int, stop: Int, step: Int): List<String> {

    val result = mutableListOf<String>()
    for (string in strings) {
        val repeatedString = string.repeat(3)  // Repeat each string thrice
        val slicedString = repeatedString.slice(start until stop step step)  // Perform string slicing with given indices
        result.add(slicedString)
    }
    return result
}