Skip to content

Latest commit

 

History

History
60 lines (42 loc) · 1.24 KB

README.md

File metadata and controls

60 lines (42 loc) · 1.24 KB

Shippy Pro - Flights price challenge

License

How to install the project

  • clone the repo on a local dir
  • compile your .env file
  • launch "composer install"
  • launch "php artisan migrate:fresh --seed"
  • launch "php artisan serve"

...and it's done!

The Challenge

Given:

TABLE 1:

  • - id
  • - name
  • - code
  • - lat
  • - lng

TABLE 2:

  • - code_departure
  • - code_arrival
  • - price

Try to create a PHP algorithm that finds the lowest price, given two different airport's code in table 1, assuming at most 2 stopovers!


The result is represented in a Blade Landing Page.

The Solution

You can find proof of solution by launching the command "php artisan test". To be more specific, the algorithm that finds the best price on DB data set can be found at class "App\Services\FlightScanner", function generalMinPriceOptimizedSearch().