MCPcopy Create free account
hub / github.com/Tiwarishashwat/InterviewCodes / isCarsRepaired

Method isCarsRepaired

MinimumTimeToRepairCars.java:24–31  ·  view source on GitHub ↗
(long time, int ranks[], int carsToBeRepaired)

Source from the content-addressed store, hash-verified

22 return ans;
23 }
24 public boolean isCarsRepaired(long time, int ranks[], int carsToBeRepaired){
25 long carsRepaired = 0;
26 for (int rank : ranks){
27 carsRepaired += (long) (Math.sqrt((1.0 * time) / rank));
28 if(carsRepaired>=carsToBeRepaired) return true;
29 }
30 return false;
31 }
32}

Callers 1

repairCarsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected