Is it multithreading or a fork?
Fork is multiprocessing - different address spaces.
Multithreading is pthread_create() (etc.) on linux is one address space.
It is easier to solve your problem in a multithreaded version than in a multiprocessed one, because the result of calculations in each thread does not need to be passed to the control thread - it will already be known due to shared memory.
In general, the algorithm is simple enough - divide your array into N chunks (by the number of real processor cores), for each chunk find the beginning offset and the end offset (of course you must find for each chunk the first opening bracket and the last closing bracket). Run a different thread for each chunk, which will work within the allocated range.
After all the threads are finished, you only have to choose the maximum of the results of the calculations in the main thread.
For the fork variant, it is about the same, but you need to think about how to pass its range to the new process and how to return the result to the main process.