/vehicles

SQLi e-Challenge 2017 HackerRank Vehicles Problem Solution.

Primary LanguageJava

Vehicles

SQLi e-Challenge 2017 HackerRank Vehicles Problem Solution.

The aim of this exercise is to design and write a code to pass all tests.

A train is made of different types of wagons: head, passenger, restaurant, and cargo. Each type has its specific representation:

  • Head :
    • <HHHH if its the last wagon
    • HHHH> if it is the first wagon
  • Passenger : |OOOO|
  • Restaurant : |hThT|
  • A cargo wagon can be either empty or loaded
    • If empty : its represented as |____|
    • If loaded: its represented as |^^^^|

The wagons are connected by "::"