Prudent Devs

Swift Challenges

Interesting swift challenges

I have started learning Swift. I was looking for programming challenges / problems that I can work on. I didn’t find any. So I am creating this series. If you are interested, subscribe via email. You can also clone Git repository.

  1. Divisible by 7 but not a multiple of 5: Write a program to find all numbers which are divisible by 7 but are not a multiple of 5, between 2000 and 3200 (both included). The numbers obtained should be printed in a comma-separated sequence on a single line.

  2. Palindrome Check: Write a program to check if the string entered by the user is a palindrome. That is that it reads the same forwards as backwards like “racecar”

  3. Unique elements from arrays: Write a program to make an array of unique elements from two arrays.

  4. Factorial of n: Write a program to compute factorial of a number.

  5. Sort words: Write a program that takes a comma separated sequence of words and prints the words in a comma-separated sequence after sorting them alphabetically.

  6. Stringify numbers: Take an array of numbers, concatenate the even numbers as a string.

  7. Luhn’s Algorithm: Validate credit card number with Luhn’s algorithm.

  8. Pangram Check: Write a program to check if the string entered by the user is a pangrams. Pangrams are sentences constructed by using every letter of the alphabet at least once.

  9. Upper and lower case letters: Write a program to count upper and lower case letters in a given string.

Published On:
Under: #code , #swift
Sign up for my newsletter