A digit in the number is useful if the number is divisible by that digit.
Here is what I have:
func selfDivide(integer: Int) -> Int {
var numString = String(integer)
for character in numString.characters {
if character % numString == 0 {
return character
}
}
}
I'm thinking I have to find a way to use % between that string and character.
The error that I get is:
Binary operator '%' cannot be applied to characters of type 'Character' and 'String'
{}
icon in the editor.