FastPrepMinimum Tunnel Crossing Time
Problems/Minimum Tunnel Crossing Time

Minimum Tunnel Crossing Time

Arcesium logoArcesium● EasyFULLTIMEOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in an Arcesium full-time online assessment. The report links directly to the prompt. Our version is about 99% the same as the reported question.

A group must pass through a tunnel of height tunnelHeight. Every person's height is strictly less than the tunnel height.

A crossing may contain either one person or two people:

  • One person takes soloTime seconds.
  • Two people may cross together only when the sum of their heights is strictly less than tunnelHeight; that crossing takes pairTime seconds.

Crossings happen one after another. Return the minimum total time needed for everyone to cross.

Function

minimumTunnelTime(heights: int[], tunnelHeight: int, soloTime: int, pairTime: int) → int

Examples

Example 1

heights = [1,3,4,4,2]tunnelHeight = 9soloTime = 4pairTime = 6return = 16

Pair heights 1 and 4, pair heights 3 and 4, and let the remaining person cross alone. The total is 6 + 6 + 4 = 16.

Example 2

heights = [1,3,4]tunnelHeight = 9soloTime = 4pairTime = 6return = 10

One valid pair crosses in 6 seconds and the remaining person crosses in 4 seconds.

Constraints

  • heights.length >= 1.
  • Every height is positive and strictly less than tunnelHeight.
  • soloTime and pairTime are positive.

More Arcesium Online Assessment questions

  • City Infection NumberOA · Seen Jul 2025
  • Product of Subset MaximaOA · Seen Jul 2025
  • Reconstruct the Root StreamOA · Seen Jul 2025
  • Add DigitsOA · Seen Aug 2023
  • Binary Tree Maximum Path SumOA · Seen Aug 2023
  • Detect a Cycle in Directed Hate RelationshipsOA · Seen Aug 2023
  • Reverse First K Characters in Every 2K BlockOA · Seen Aug 2023
  • Robo Data Sharing DirectionOA · Seen Jul 2023
  • Capital Gains Tax from TradesOA · Seen Feb 2021
  • K-th Character in an Infinite StringOA · Seen Aug 2020

Similar questions at other companies

  • Catch Fish with Reusable BaitsSusquehanna International Group (SIG) · OASusquehanna International Group (SIG) interview questions
  • Can Every Package Fit in a BoxIMC Trading · OAIMC Trading interview questions
  • Get Maximum PairsAmazon · OA
  • Find Maximum GreatnessTwilio · OATwilio interview questions
  • Binge WatchingVanguard · OAVanguard interview questions
  • Maximum Easy Tasks After RearrangingIBM · OAIBM interview questions
  • Latest Arrival to Catch a BusAutodesk · OAAutodesk interview questions
  • Minimum Removals to Balance ArraySalesforce · OASalesforce interview questions
  • Minimum Machines for TasksExpedia · OAExpedia interview questions
  • Find Minimum Possible SizeMathWorks · OAMathWorks interview questions
All Arcesium interview questionsSee Arcesium hiring insights
Saved
class Solution {
    public int minimumTunnelTime(int[] heights, int tunnelHeight, int soloTime, int pairTime) {
      // Write your code here.
    }
}
Checking account…