We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b0f3f52 commit 67eb3bfCopy full SHA for 67eb3bf
javascript/2651-calculate-delayed-arrival-time.js
@@ -0,0 +1,16 @@
1
+/**
2
+ * @param {number} arrivalTime
3
+ * @param {number} delayedTime
4
+ * @return {number}
5
+ */
6
+var findDelayedArrivalTime = function (arrivalTime, delayedTime) {
7
+ let totalTime = arrivalTime + delayedTime; // initialize totalTime is the sum of arrivalTime and delayedTime
8
+
9
+ if (totalTime == 24) { // if totalTime is equal to 24 then return 0
10
+ return 0;
11
+ } else if (totalTime < 24) { // if totalTime is less than 24 then return totalTime
12
+ return totalTime;
13
+ } else { // else return subtraction of totalTime to 24
14
+ return totalTime - 24;
15
+ }
16
+};
0 commit comments