Reverse Train Time

A railway display board shows the arrival times of trains in minutes remaining. To simulate a reset, you need to print the given array of arrival times in reverse order.

A railway display board shows the arrival times of trains in minutes remaining. To simulate a reset, you need to print the given array of arrival times in reverse order.

Input formatLink to this section

  • Line 1: An integer N representing the number of trains
  • Line 2: N space-separated integers representing the arrival times

Output formatLink to this section

  • Line 1: The N integers in reverse order, separated by a single space

ConstraintsLink to this section

  • 1 <= N <= 100
  • 0 <= time <= 1440

tip

Loop from the last index down to zero and print each element.

Rate this content

Sign in to rate

Discussion

Sign in to join the discussion