SHARE
TWEET

Untitled

a guest May 25th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. func expandNumber(numToExpand: Int) -> [Int] {
  2.    
  3.     //let numString = String(numToExpand)   combined it
  4.    
  5.     let backwardsArray = String(numToExpand).reversed().map { Double(String($0)) }
  6.     let resultArray = backwardsArray.map { $0 * pow(10.0, .index) }
  7.     return resultArray.reversed().map { Int($0) }
  8.    
  9.     // apparently i need to do this all with just atrings, and just add zeroes based on array position, what i'm doing is way too complicated
  10.  
  11.    
  12. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top