Home / Expert Answers / Computer Science / please-help-to-solve-this-simple-coding-problem-thanks-nbsp-this-coding-problem-can-use-any-prog-pa792

(Solved): Please help to solve this simple coding problem, thanks!  This coding problem can use any prog ...



Please help to solve this simple coding problem, thanks! 

This coding problem can use any programming languages, Python or jave both okay

Description:
Youve recently started managing a theme park but have run into a problem: Youre never sure if the park is empt

Examples:
Input: \( \quad[2,-5,7,-2,-6,5] \)
Output: \( \quad \) OPEN
Explanation: A group of 5 and 6 left the park before

Language Python 3
(i)
Q Au

Description: You've recently started managing a theme park but have run into a problem: You're never sure if the park is empty or not when it's time to close for the night. Your equipment is so bad, you're not even sure your records are correct! You will be provided with an array of positive and negative integers representing a record of the comings and goings of groups inside the park for the day. Each integer represents the party size of a group either entering (positive) or exiting (negative) the park. Groups never split up or combine, and a valid record will never show a group leaving the park before they enter. In order to close the park for the day, you need the park to be empty. Write a function that returns 'CLOSE' if the park can safely close or 'OPEN' if there are still people in the park or the record is invalid. Note: Group sizes are not unique. There can be multiple parties of the same size in the park Examples: Input: \( \quad[2,-5,7,-2,-6,5] \) Output: \( \quad \) 'OPEN' Explanation: 'A group of 5 and 6 left the park before entering, so this is an invalid log and the park must remain open.' Input: \( \quad[9,9,8,-8,-9,-9,9,-9] \) Output: \( \quad \) 'CLOSE' Explanation: ' 'The groups weren't unique, but all groups that entered the park have left. The park may close.' Language Python 3 (i) Q Au


We have an Answer from Expert

View Expert Answer

Expert Answer


Answer : For the Counting Tickets program in the Python will be Close when
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe