<commit_before>//
//  palindromo.swift
//
//  Created by <NAME> on 14/11/20.
//

import Foundation

func isPalindrome(_ string: String) -> Bool {
    let lowercasedString: String = string.lowercased().replacingOccurrences(of: " ", with: "")
    var reversedString = ""
    
    var reversedStringArray = Array(lowercasedString)
    reversedStringArray.reverse()
    for word in reversedStringArray { reversedString += "\(word)" }
    
    return (lowercasedString == reversedString)
}

print(isPalindrome(""))
print(isPalindrome("a"))
print(isPalindrome("abba"))
print(isPalindrome("abbas"))
print(isPalindrome("tattarrattat"))
print(isPalindrome("Was it a palindrome?"))
print(isPalindrome("No lemon, no melon"))
<commit_msg>Ajuste swift palindromo<commit_after>//
//  palindromo.swift
//
//  Created by <NAME> on 14/11/20.
//

import Foundation

func isPalindrome(_ string: String) -> Bool {
    let lowercasedString: String = string.lowercased().replacingOccurrences(of: " ", with: "")
    let reversedString = String(lowercasedString.reversed())
    return (lowercasedString == reversedString)
}

print(isPalindrome(""))
print(isPalindrome("a"))
print(isPalindrome("abba"))
print(isPalindrome("abbas"))
print(isPalindrome("tattarrattat"))
print(isPalindrome("Was it a palindrome?"))
print(isPalindrome("No lemon, no melon"))

{'fraction_non_alphanumeric': 0.15199398043641835, 'fraction_numerical': 0.009029345372460496, 'mean_word_length': 5.273584905660377, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4482088', 'n_tokens_mistral': 473, 'n_tokens_neox': 448, 'n_words': 87}