c++

[Solved] Construct Product Matrix C++, Java, Python

Product Matrix

Given a 0-indexed 2D integer matrix grid of size n * m, we define a 0-indexed 2D matrix p of size n * m as the product matrix of grid if the following condition is met: Return the product matrix of grid. Example 1:Input: grid = [[1,2],[3,4]] Output: [[24,12],[8,6]] Explanation: p[0][0] = grid[0][1] * grid[1][0] * grid[1][1]…

[Solved] Equal Hamming Distance CodeChef Starters 75

[Solved] Equal Hamming Distance CodeChef Starters 75

Chef is given two binary strings A and B, each having length N. Chef wants to find the number of binary strings �C, of length �N, such that �(�,�)=�(�,�)H(A,C)=H(B,C), where �(�,�)H(X,Y) denotes the hamming distance between the strings �X and �Y. Since the answer can be large, output it modulo 109+7109+7. Note: Hamming distance between two strings…

[Solved] Diagonal Intercoms with C++

[Solved] Diagonal Intercoms with C++

Diagonal Intercoms: Mayflower Manor was a neatly gridded apartment which consists of 1000 by 1000 houses. The inmates of the flat requested the Apartment Association Members to connect the flat using intercom systems to communicate messages during any emergency situations…

Commonly Asked C++ Interview Question

Commonly Asked C++ Interview Question

Ans: C C++ C is a procedure-oriented programming language. C++ is an object-oriented programming language. Function and operator overloading are not supported in C Function and operator overloading is supported in C++ calloc() and malloc() functions are used for memory…