colinfwalsh / ios-collections-and-strings-problems-ios-0616

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Collections and Strings Problems

Objectives

  1. Get more practice by solving problems with the Objective-C basics!

Instructions

Write functions that accomplish the following tasks:

  1. Write a method that takes a list of strings an prints them, one per line, in a rectangular frame. For example the list ["Hello", "World", "in", "a", "frame"] gets printed as:

    *********
    * Hello *
    * World *
    * in    *
    * a     *
    * frame *
    *********
    
  2. Write a method that translates text to Pig Latin and back. English is translated to Pig Latin by taking the first letter of every word, moving it to the end of the word and adding ‘ay’. “The quick brown fox” becomes “Hetay uickqay rownbay oxfay”. Note how we preserving the capitalization of a sentence.

  3. Write a method that combines two lists by alternatingly taking elements, e. g. [a, b, c], [1, 2, 3] becomes [a, 1, b, 2, c, 3].

  4. Write a function that takes a number and returns an array of its digits as numbers between 0-9. For instance, 12045 would result in @[ @1, @2, @0, @4, @5 ].

  5. Write function that reverses an array. Now do it in-place: that is, without allocating a separate array.

View Collections and Strings Problems on Learn.co and start learning to code for free.

About


Languages

Language:Objective-C 61.8%Language:Shell 38.2%