In C++, write a method to check if values of char[] arrays are complementary to each other

Question

Check if values are complementary to each other. For example, “1111” and “0000” are complementary to each other, while “1011” and “0101” are not complementary to each other.

Explanation

First check if the length of the 1st array is equal to the length of the 2nd array. If it’s not equal, then return false.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store