Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public int findBayOfCar(int carNumber) {
- int number[];
- number = new int[cars.length];
- int count = 0;
- for (int i = 0; i<cars.length;i++) {
- if (isEmpty(i)) {
- continue;
- }
- else {
- count++;
- number[i]=count;
- }
- if (count == carNumber) {
- return i;
- }
- }
- return count;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement