We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Algorithms
- Debugging
- Minimum Operations
- Discussions
Minimum Operations
Minimum Operations
Sort by
recency
|
39 Discussions
|
Please Login in order to post a comment
a passion for technology and a commitment to delivering valuable content at mydroidalerts.com, I am here to learn, inform, inspire, and engage.
def min_operations(n, boxes): # Separate the balls in each box for i in range(1, n): for j in range(3): if boxes[i][j] != boxes[0][j]: boxes[i][j] = boxes[0][j]
Input reading
n = int(input()) # Number of boxes boxes = [list(map(int, input().split())) for _ in range(n)] # List of boxes
Get the result
result = min_operations(n, boxes) Run this Python code and input the number of boxes along with the colors of balls in each box. It will output the minimal number of operations required to separate the balls. Moreover, for debugging apply update from adb and then run this python code.
Print the result
print(result)
gg, no pyhon option
Wrong Answer :(
2/2 test cases failed
Sample Test case 0
Sample Test case 1 Compiler Message Wrong Answer Input (stdin) 1 5 6 8 Your Output (stdout) -1 Expected Output -1
Wrong Answer :(
2/2 test cases failed
Sample Test case 0
Sample Test case 1 Compiler Message Wrong Answer Input (stdin) 3 1 1 1 1 1 1 1 1 1 Your Output (stdout) 6 Expected Output 6
Is Python not cool for this task? :D