Matrix Division
Description:
When multiplying matrices, the of the product matrix C is equal to the sum of pairwise products of the elements of of the left matrix A and elements of of the right matrix B. For this kata, we will redefine matrix multiplication by removing the step with summation so that division of matrices can be unambiguously defined:
Task:
Implement a function matrix_div
with 3 parameters:
result represents the product matrix C
factor represents one of the two factors (either A or B).
position is either 0 or 1: 0 means that given factor is the left factor while 1 means it's the right one.
Func should return the other factor.
Examples:
matrix_div([[[5, 14], [6, 16]], [[15, 28], [18, 32]]], [[1, 2], [3, 4]], 0)
should return [[5, 6], [7, 8]]
matrix_div([[[5, 14], [6, 16]], [[15, 28], [18, 32]]], [[1, 2], [3, 4]], 1)
should return [[5, 4], [15, 8]]
Constraints:
- for convenience
Similar Kata:
Stats:
Created | Jul 23, 2023 |
Published | Jul 23, 2023 |
Warriors Trained | 277 |
Total Skips | 112 |
Total Code Submissions | 147 |
Total Times Completed | 43 |
Python Completions | 43 |
Total Stars | 9 |
% of votes with a positive feedback rating | 92% of 24 |
Total "Very Satisfied" Votes | 21 |
Total "Somewhat Satisfied" Votes | 2 |
Total "Not Satisfied" Votes | 1 |
Total Rank Assessments | 12 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 4 kyu |
Lowest Assessed Rank | 7 kyu |