There is a coding problem where we are given some inputs and we have to tell if a matrix can be made or not. we are given the size of the matrix. Then the second line of the input, signifies the row of the matrix. It some numbers. And the third line signifies column.
Example: 3 3 (size of matrix) 2 1 0 (rows of the matrix) 1 2 (column of the matrix) In the second line, 2 implies that the two elements of the first row has to be filled with X while others will be zero. 1 says that only one element of the second row will be populated with X and similarly, 0 means the third row has no X populated. Similarly, in 3rd line, 1 refers to that only 1 element in the first column should be filled with X. and 2 says that two elements in the second column are filled with X. So if we follow this, we wont have any combination that will satisfy our matrix. Any idea how can I implement such an algorithm that will check if the matrix is possible or not. When I am creating examples, I feel that there is a pattern in the input that i am missing. So it will be great if anyone can suggest me if i am missing anything. Thanks in advance. I was asked this question in an amazon interview. I am really confused how much more do I need to practise. -- You received this message because you are subscribed to the Google Groups "Google Code Jam" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/google-code/ef3647ae-e2c1-4adf-9a29-3201014288e5%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
