Test 5 Solution
Test 5 Solution
Assignment:-
1. Matrix
public class mat{
int[][] matrix;
mat(int[][] mat) {
matrix = mat;
}
while(head != null)
{
sum = carry + head.data;
carry = (sum>=10) ? 1:0;
sum = sum%10;
head.data = sum;
temp = head ;
head = head.next;
LinkedListNode<Integer>newNode = null;
if(carry > 0)
newNode = new LinkedListNode<Integer>(carry);
temp.next = newNode;
return res;