We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
for item in items {} is how for cycle is intended for Swift. The block {} will be executed items.count times and 'item' variable will assume each value of 'items' per iteration.
In my code I used 'integer' as variable.
According to that, int2reverse is initialized with 'integer' that is an int value equals to 'i' at first iteration, i+1, ... j in the last iteration.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Beautiful Days at the Movies
You are viewing a single comment's thread. Return to all comments →
for item in items {} is how for cycle is intended for Swift. The block {} will be executed items.count times and 'item' variable will assume each value of 'items' per iteration. In my code I used 'integer' as variable. According to that, int2reverse is initialized with 'integer' that is an int value equals to 'i' at first iteration, i+1, ... j in the last iteration.