153k views
0 votes
rohit reached the office at 9:45:56 hours on 1st june 2019, and rahul reached at 9:45:56 hours on 1st june 2019. rohit left from the office at 14:45:56 hours on 1st june 2019, and rahul left from the office at 15:45:56 hours on 1st june 2019. how many total seconds did they both spend together in the office? example input - if both rahul and rohit came and left the office at the same time as below: intime - 2019-01-01 15:45:56 outtime - 2019-01-01 15:46:56 example output: 120

2 Answers

1 vote

Final answer:

To find the total seconds they both spent together in the office, we need to calculate the time difference between their arrival and departure.

Step-by-step explanation:

To find the total seconds they both spent together in the office, we need to first calculate the time difference between their arrival and departure.

Rohit arrived at 9:45:56 and left at 14:45:56, which means he spent 5 hours in the office. This is equivalent to 5 hours * 60 minutes * 60 seconds = 18,000 seconds.

Rahul arrived at the same time and left at 15:45:56, which means he spent 6 hours in the office. This is equivalent to 6 hours * 60 minutes * 60 seconds = 21,600 seconds.

Adding the seconds spent by both Rohit and Rahul, we get a total of 18,000 seconds + 21,600 seconds = 39,600 seconds.

User Chiappone
by
8.2k points
6 votes

Final answer:

To find the total time that Rohit and Rahul spent together in the office, calculate the time difference between their arrival and departure times. Then, add the time differences and convert the total time to seconds.

Step-by-step explanation:

To find the total time that Rohit and Rahul spent together in the office, we need to calculate the time difference between their arrival and departure times.

First, we find the time difference for Rohit:

  • Arrival time: 9:45:56
  • Departure time: 14:45:56
  • Time difference: 14 hours, 0 minutes, 0 seconds

Next, we find the time difference for Rahul:

  • Arrival time: 9:45:56
  • Departure time: 15:45:56
  • Time difference: 15 hours, 0 minutes, 0 seconds

To calculate the total time spent together, we add the time differences for both Rohit and Rahul:

  • Total time: 14 hours + 15 hours = 29 hours

Finally, we convert the total time to seconds:

  • Total time in seconds: 29 hours * 60 minutes * 60 seconds = 104,400 seconds

Therefore, Rohit and Rahul spent a total of 104,400 seconds together in the office.

User Jessie Lesbian
by
7.3k points