Company: Aveva_24oct
Difficulty: medium
Fair Indexes Problem Description You are given two integer arrays A and B , each of length N . Cutting both arrays at the same index K splits each of them into a left part and a right part: A[0] + A[1] + ... + A[K-1] (left part of A ) A[K] + A[K+1] + ... + A[N-1] (right part of A ) B[0] + B[1] + ... + B[K-1] (left part of B ) B[K] + B[K+1] + ... + B[N-1] (right part of B ) The index K is called fair when all four of these sums are equal. Every part must be non-empty, so only 1 <= K <= N - 1 is considered. Complete the function solution(A, B) , which returns the number of fair indexes. Input Format Read from standard input. N A[0] A[1] ... A[N-1] B[0] B[1] ... B[N-1] The first line contains the integer N . The second line contains the N elements of A , separated by spaces. The third line contains the N elements of B , separated by spaces. Output Format Print a single integer: the number of fair indexes. Constraints 2 <= N <= 8000 (inferred -- the source states N <= 100,00