Why is my Swift loop failing with error “Can't form range with end < start”?

后端 未结 6 1627
北海茫月
北海茫月 2021-02-05 01:44

I have a for loop that checks if a number is a factor of a number, then checks if that factor is prime, and then it adds it to an array. Depending on the original number, I wil

6条回答
  •  北荒
    北荒 (楼主)
    2021-02-05 02:16

    In your second loop, i will always start at 2, which means you're looping from 2...1

提交回复
热议问题