Reported interview periodNot available
Dot product of two long integer vectors
Read a shared length and two integer vectors of that length, then return their dot product as a decimal string. Most entries are zero, so the useful work should follow the non-zero positions rather than the dec…
Practice focusRequirements - Line 1 is the length n ; line 2 holds n integers for the first vector; line 3 holds n integers for the second. - Some inputs carry the two characters backslash and n instead of real line breaks; treat both forms as line separators before parsing. - Multiply matching positions, then add the products. Entries may be negative, so the sum can be negative or zero. - Return the total as a plain decimal string with no padding, no plus sign, and no newline. - Do not print the individual products or the operand vectors.…