+ 4
Issue with Solving Divisible In Swift (Code Coach)
Hello. I noticed when trying to solve Divisible in Swift, only Test Case 3 is not solved. I even tried a simple print of “divisible by all” or “not divisible by all” to see if Test Case 3 turns green. It stayed red both times. Is this a known unresolved issue?
4 Respuestas
+ 14
Hi. I met the same situation and solved by the below for the first input.
var input = readLine()!
var dummy = input.split(separator: ' ')
var first = Int(dummy[0])
In only Test Case 3, SPACE probably exists behind the fist input's number.
+ 6
Satoshi Hirano, THANK YOU SO MUCH!!! I did not realize that there may have been an extra space next to the first number. 😅😅. I hope SoloLearn sees your comment and make the necessary changes. Thanks again 😊😊😊
+ 4
I just checked test 3 passed by :
print("divisible by all")
+ 3
My code didn't pass the 3rd test either. I tried to input the example given in the problem statement, with extra space and it worked normally.