kucheasysa

Algoverse_adesh_19

Jun 16th, 2024
535
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. #User function Template for python3
  2.  
  3. class Solution:
  4.     def sortedMatrix(self,N,Mat):
  5.   #code here
  6.         ans = []
  7.         x=0
  8.         for i in Mat:
  9.             ans.extend(i)
  10.         ans.sort()
  11.        
  12.         for i in range(N):
  13.             for j in range(N):
  14.                 Mat[i][j] = ans[x]
  15.                 x = x+1
  16.         return Mat
  17.  
  18.  
Advertisement
Add Comment
Please, Sign In to add comment