##
Sum 2D array in Python using map() function
October 28, 2017

Given a 2-D matrix, we need to find sum of all elements present in matrix ? Examples: Input : arr = [[1, 2, 3], [4,… Read More »

October 28, 2017

Given a 2-D matrix, we need to find sum of all elements present in matrix ? Examples: Input : arr = [[1, 2, 3], [4,… Read More »

October 27, 2017

Conways’s Game Of Life is a Cellular Automation Method created by John Conway. This game was created with Biology in mind but has been applied… Read More »

Given an n x n matrix containing all the numbers in the range 0 to n2-1. The problem is to calculate the total energy required… Read More »

October 26, 2017

Given a n × m binary matrix, count the number of sets where a set can be formed one or more same values in a… Read More »

October 18, 2017

Given a sorted matrix of size n*n. Calculate the mean and median of the matrix . Examples: Input : 1 2 3 4 5 6… Read More »

October 17, 2017

In linear algebra, a matrix decomposition or matrix factorization is a factorization of a matrix into a product of matrices. There are many different matrix… Read More »

October 15, 2017

In numerical analysis and linear algebra, LU decomposition (where ‘LU’ stands for ‘lower upper’, and also called LU factorization) factors a matrix as the product… Read More »

October 13, 2017

Given a matrix of N*M order. Find the shortest distance from a source cell to a destination cell, traversing through limited cells only. Also you… Read More »

October 12, 2017

A Magic Square is a n x n matrix of distinct element from 1 to n2 where the sum of any row, column or diagonal… Read More »

Given a matrix of size n x m consisting of 0’s and 1’s.We need to find number of unique cells with value 1 such that… Read More »

October 9, 2017

You are given a square matrix (matrix[][]) of order n, where matrix[i][j] = i*j. Find the number of cells which have entry equal to a… Read More »

October 8, 2017

A matrix is a two dimensional data objects having m rows and n columns, therefore a total of m*n values. If most of the values… Read More »

October 2, 2017

Given a matrix of N rows and M columns. From m[i][j], we can move to m[i+1][j], if m[i+1][j] > m[i][j], or can move to m[i][j+1]… Read More »

Given a square matrix, find out count of numbers that are same in same row and same in both primary and secondary diagonals. Examples: Input… Read More »

October 1, 2017

Given a m x n matrix mat[][] containing positive integers. The problem is to reach to the cell (m-1, n-1) from the cell (0, 0)… Read More »