You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If one or more spots fail, it seems to still decrease the number of available spots, and also doesn't free the spots that succeeded. This should be an "all-or-nothing" kind of transaction. Potentially, if a level fails to park the vehicle, the following level should try, which then starts by clearing the spots on the given vehicle. To make sure we are clearing the correct number of vehicles vs. decreasing the correct number of available spots, a workaround would be to decrease the available spots by the actual number of spots that were filled rather than the vehicle's number of spots needed.
The text was updated successfully, but these errors were encountered:
ctci/java/Chapter 8/Question8_4/Level.java
Line 46 in 5f6b459
If one or more spots fail, it seems to still decrease the number of available spots, and also doesn't free the spots that succeeded. This should be an "all-or-nothing" kind of transaction. Potentially, if a level fails to park the vehicle, the following level should try, which then starts by clearing the spots on the given vehicle. To make sure we are clearing the correct number of vehicles vs. decreasing the correct number of available spots, a workaround would be to decrease the available spots by the actual number of spots that were filled rather than the vehicle's number of spots needed.
The text was updated successfully, but these errors were encountered: