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

All About Code
1 min readMay 13, 2022

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.

--

--