Meesho Coding Question – Solved

8 Live
Take it apart Given an array A of length N, Alex and Bob have decided to play a game called "Take it apart." At the beginning of the game, players pick a side of the array, either the start (S) or the end (E), and it's fixed for the rest of the game. Then, they start playing in turns. Alex goes first. They pick a number from their side and remove the number from the array. This number is considered collected by the respective player. Task Your task is to calculate the minimum absolute difference between the sum of collected numbers by Alex and Bob. Function description Complete the function solve provided in the editor. This function takes the following two parameters and returns the required answer: - N: Represents the size of the array A. - A: Represents the numbers in the array A. Input format Note: This is the input format that you must use to provide custom input. - The first line contains T, denoting the number of test cases. T also specifies the number of times you have to run the solve function on a different set of inputs.

Asked in: Meesho

Image of the Question

Question Image

All Testcases Passed βœ”



Passcode Image

Solution


Please login to view the solution


Related Questions

| Given an n x m grid, where rows are numbered from 7 to n and columns from 1 to … |
| There are 'N' coders standing in a line, where i denotes the ith position of a … |
| A birthday party was attended by N number of kids, and each kid was given a uni… |
| Given a matrix of size m * n, where m denotes the number of rows (starting with… |
| A traveler is traveling from the city of Zeta to Omega. He starts with X amount… |
| As an operations engineer at Amazon, you are responsible for organizing the dis… |