Question d’entretien chez Bloomberg

Has Ships, leetcode hard question6