/**
 * Given two words, return the common letters between them as a string. The common letters should be in the same order as they appear in the first word.
 *
 * @param word1 First word
 * @param word2 Second word
 * @return String containing the common letters between the two words
 *
 * Example:
 * findCommonLetters("archaeologist", "letter") -> "let"
 */
fun findCommonLetters(word1: String, word2: String): String {

    var commonLetters = ""
    for (letter in word1) {
        if (letter in word2) {
            commonLetters += letter
        }
    }
    return commonLetters
}
/**
 * Given two words, return the common letters between them as a string. The common letters should be in the same order as they appear in the first word.
 *
 * @param word1 First word
 * @param word2 Second word
 * @return String containing the common letters between the two words
 *
 * Example:
 * findCommonLetters("archaeologist", "letter") -> "let"
 */
fun findCommonLetters(word1: String, word2: String): String {
/**
 * Given two words, return the common letters between them as a string. The common letters should be in the same order as they appear in the first word.
 *
 * @param word1 First word
 * @param word2 Second word
 * @return String containing the common letters between the two words
 *
 * Example:
 * findCommonLetters("archaeologist", "letter") -> "let"
 */
fun findCommonLetters(word1: String, word2: String): String {

    var commonLetters = ""
    for (letter in word1) {
        if (letter in word2) {
            commonLetters += letter
        }
    }
    return commonLetters
}