Skip to content

Some swift algorithms to have fun using Playground on Xcode 11

Notifications You must be signed in to change notification settings

patagonia2019/swift-algo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

swift-algo

Some swift algorithms to have fun using Playground on Xcode 11

Prerequesites

  • Xcode 11
  • Swift 5

Disclosure

Take in account, some algorithms are not checked in terms of performance.

Please review and propose another way

Please take a look the algorithm, fork, copy, use as you wish, but help me to figure out another way, or another option, for example you will see here algorithms for narrow cases, you can propose a general big one to solve more cases.

List of Algorithms

  • PlaneSeats.playground: Assign passengers seats in an airplane, allocating seats for as many four-person families as possible, from seats between 1A to 1J, assuming a number of 50 rows, taking account reserved and 2 aisles in between. Performance not checked.
  • MatrixLayerRotationQuick.playground: You are given a 2D matrix of dimension and a positive integer . You have to rotate the matrix times and print the resultant matrix. Rotation should be in anti-clockwise direction. Good Performance.
  • MorganAndString.playground: lexicographically minimal string made of those two collections. Bad Performance.

About

Some swift algorithms to have fun using Playground on Xcode 11

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages