Optimal Time Calculation - Find Delayed Arrival Time | 0ms Solution in C++
Intuition:\nThe problem requires calculating the delayed arrival time by adding the scheduled arrival time and the delay duration. If the total exceeds 24 hours
# Intuition:\nThe problem requires calculating the delayed arrival time by adding the scheduled arrival time and the delay duration. If the total exceeds 24 hours, we subtract 24 to adjust for the 24-hour clock format.\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach:\nAdd the scheduled arrival time (scheduledArrivalTime) and the delay duration (delayDuration).\nIf the sum exceeds or equals 24, subtract 24 to wrap the time within the 24-hour format.\nReturn the adjusted arrival time.\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- **Time complexity:**\n O(1) \u2014 constant time operations are performed.\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- **Space complexity:**\n O(1) \u2014 no extra space is used besides a few variables.\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    int findDelayedArrivalTime(int a, int d) {\n        int sum=a+d;\n        if(sum>=24)\n        {\n            sum=24-sum;\n        }\n        return abs(sum);\n    }\n};\n```
['Math', 'C', 'C++']