sir 2 question matrix 180 rotate wala wawe length wala concept v use kr skte h na wawe row mai use kre to (ak raste jesa daigram bn jayega ) last se start kre or first col mai print krana
31:34 HW to rotate by 180 void rotate(vector& matrix) { int degree = 180; while(degree){ rotate90(matrix); degree -= 90; } } rotate90 is the function that we implemented in leetcode.
TIME STAMPS 0:08 Rotate matrix by 90° 13:42 with Space O(1) 26:58 implemetion part(leetcode) 30:04 Rotate by 180° 41:12 code implementation (gfg) 43:43 previous approach 44:14 Rotate by 90° anticlockwise 47:01 2nd approach (direct) 50:29 Rotate matrix by k times
00:02 Solving problems related to matrix rotation. 02:07 Identifying and understanding a pattern in matrix elements. 06:34 Identified constant relation in the pattern 09:22 Rotating matrix elements by 90 degrees 14:06 Understanding the relationship between columns and rows in matrix rotation 16:23 Transposing and reversing matrix elements to solve the problem 20:46 Algorithm to rotate a matrix by 90 degrees 23:02 Rotate matrix elements 26:55 Rotate the image in a square matrix 28:57 Rotating Matrix by 180° 32:48 Rotate the matrix elements in a specific pattern. 34:50 Exploration of matrix rotation by reversing columns and rows 39:00 Rotating matrix elements row-wise 41:00 Method for rotating matrix elements by 180 degrees 44:37 Rotate matrix elements by 90 degrees 46:34 Rotate matrix elements clockwise by 90 degrees. 50:31 Understanding rotations in a matrix 53:25 Rotating a matrix by 90 degrees 56:57 Understanding the rotation of elements in a matrix. 58:40 Rotating matrix by 90 degrees Crafted by Jayant Kumar(Forenus)
Mazza aagya bhiyaa padh ke, literally agar aap 3 hr ka bhi lecture upload kare n to bhi consistently dekhunga m vo bhi bohot mazze ke saath❤☺️ Aapke lecture me har sec kch kch naya sikhe ko milta h humko.... Ooh man,you are gem💎
Succhi bta rha bhaiya Aaj ka class kar ke lg rha ki rotate ki koi problem chutki me solve kar sakta hu❤❤, love you Rohit bhaiya I am big fan of you 🙏🙏💗
bhai kiya he yar kiya he ho bhaiya ap , ahse thore google mil giya concept isse kahte hai yarr ,,,, kasam se me ek video dekha ab me pura playlist dekhne walahu
In 180Degree roated array we also do this an bhaiya that we reverse the 2D-array Row elements as we do, and after that we swap the 2D-array rows, logic:- if 2D-array of 2*2 then we reverse all 4row elements and we swap 0-row with 3-row and 1-row with 2-row code:- void rotate(vector& matrix) { // Code here int n = matrix.size(); // code of reverse row elements for(int i=0; i
matrix rotation by 180 degree( my approch ) class Solution { public: void rotate(vector& matrix) { // Code here int n=matrix.size(); int i=0,j=n-1,start=0,end=n-1;
class Solution { public: void rotate(vector& matrix) { // Code here int n = matrix.size(); for(int i = 0; i < n-1; i++) { for(int j = i +1; j < n; j++) { swap(matrix[i][j], matrix[j][i]); } } for(int i = 0; i < n; i++) { int start = 0, end = n-1; while(start
before 46:39, I thought of this solution in different way. //approach first we find transpose of the matrix //reverse it by column #include using namespace std; void reverseCol(int arr[][3]){//column wise reverse for(int j=0;j
i did like this #include using namespace std; // brute force approach void print(int arr[][4], int row, int col) { for (int i = 0; i < row; i++) { for (int j = 0; j < col; j++) { cout
Kaisa laga aaj ka concept...
Good Morning Bhaiya
Chamak Raha hai
sir 2 question matrix 180 rotate wala wawe length wala concept v use kr skte h na
wawe row mai use kre to (ak raste jesa daigram bn jayega ) last se start kre or first col mai print krana
Mast laga concept bhaiya. ❤❤
sir whatsupp pe add nhi ho pa rha hu mai
31:34 HW to rotate by 180
void rotate(vector& matrix) {
int degree = 180;
while(degree){
rotate90(matrix);
degree -= 90;
}
}
rotate90 is the function that we implemented in leetcode.
We can do degree %= 360 to avoid unnecessary rotating.
Bro you worked hard when you were preparing for placement in IIT.. I want to be like you 🔥❤🔥
TIME STAMPS
0:08 Rotate matrix by 90°
13:42 with Space O(1)
26:58 implemetion part(leetcode)
30:04 Rotate by 180°
41:12 code implementation (gfg)
43:43 previous approach
44:14 Rotate by 90° anticlockwise
47:01 2nd approach (direct)
50:29 Rotate matrix by k times
Best explanation bhaiya ❤
34:45 Two more approaches to rotate a matrix by 180 Degree
Approach 1
// Transpose matrix about diagonal
for(int i = 0; i < mat.size() - 1; i++)
for(int j = i+1; j < mat.size(); j++)
swap(mat[i][j], mat[j][i]);
// Transpose matrix about anti-diagonal
for(int j = n - 1; j > 0; j--)
for(int i = j - 1; i >= 0; i--)
swap(mat[n - j - 1][i], mat[n - i - 1][j]);
Approach 2
//Swapping the elements row wise to the top & bottom row
for(int j = 0; j < n; j++)
{
int top = 0, bottom = n - 1;
while(top < bottom)
{
swap(mat[top][j], mat[bottom][j]);
top++, bottom--;
}
}
// Reverse the rows
for(int i = 0; i < n; i++)
{
int low = 0, high = n - 1;
while(low
Awesome bro 😎
Best teacher of DSA ❤
Best video on yotube for matrix rotation
Bhaiya u are the besttt❤❤❤❤❤
So called famous channels are also not providing this clarity
00:02 Solving problems related to matrix rotation.
02:07 Identifying and understanding a pattern in matrix elements.
06:34 Identified constant relation in the pattern
09:22 Rotating matrix elements by 90 degrees
14:06 Understanding the relationship between columns and rows in matrix rotation
16:23 Transposing and reversing matrix elements to solve the problem
20:46 Algorithm to rotate a matrix by 90 degrees
23:02 Rotate matrix elements
26:55 Rotate the image in a square matrix
28:57 Rotating Matrix by 180°
32:48 Rotate the matrix elements in a specific pattern.
34:50 Exploration of matrix rotation by reversing columns and rows
39:00 Rotating matrix elements row-wise
41:00 Method for rotating matrix elements by 180 degrees
44:37 Rotate matrix elements by 90 degrees
46:34 Rotate matrix elements clockwise by 90 degrees.
50:31 Understanding rotations in a matrix
53:25 Rotating a matrix by 90 degrees
56:57 Understanding the rotation of elements in a matrix.
58:40 Rotating matrix by 90 degrees
Crafted by Jayant Kumar(Forenus)
best ever dsa playlist ive ever saw.
Done with Day 45/180, really enjoyed your explanation bhai. Thanks for ur dedication☺.
Mazza aagya bhiyaa padh ke, literally agar aap 3 hr ka bhi lecture upload kare n to bhi consistently dekhunga m vo bhi bohot mazze ke saath❤☺️
Aapke lecture me har sec kch kch naya sikhe ko milta h humko....
Ooh man,you are gem💎
Hey
R u on telegram or insta
Bhaiyya kal mujhe LEETCODE par October 23 ka badge mila,aap ke wajah se hi consistent reh paya pure mahine tak, Shukriya ❤
M bs questions krti hu per day to mujh kb tk milega
Reply please
❤liking from both accounts on laptop and phone
41:05 Alternative approach to rotate by 180.
for(int i=0; i
Level of teaching is next level bhiya
You life story is a motivation in its own
great lecture sir thank you
Bhaiya, Ek dum Chamak Gye. You are Herooo..
49:39 yes
31:28
//Matrix rotation by 180
thank you so much Bhaiya
void rotate(vector& matrix) {
int n=matrix.size();
for(int i=0;i
Good Morning Bhaiya 😊🙏🙏
Day45/180
Thank you so much sir 🥰
31:53
int k=2;
while(k>0){
int n = matrix.size();
for(int i=0;i
loved today's lecture
Thanks bhaiya for explaining such hard questions in easy manner❤
great bhaiya❤🩹❤❤❤
Simply awesome ❤❤
mayne apka anti clock wise wala solution apke bolnese phle solve kardiya apka or mera solution mil gaya bilkul
awesome lecture
maja aagya aaj 😊
amazing lecture rohit bhaiya
Amazing teaching sirrrr
Crystal clear
really good explanation please keep making such tutorials :)
bhaiya u r the best for DSA
Yes ,it can be done 49:30
bohut bariya bhaiya
Aaj, padke maja aa gya bhaiya, tq bhaiya😄😄
maza aagya bhaiya !!!!!!
maja agaya bhaiya crystal clear
Succhi bta rha bhaiya Aaj ka class kar ke lg rha ki rotate ki koi problem chutki me solve kar sakta hu❤❤, love you Rohit bhaiya I am big fan of you 🙏🙏💗
totally nailed it
Bhaiya you are an amazing teacher and mentor..
The way you teach is top level.
♥️
very nice full understanding video
Beautiful concepts bhaiya❤
bhai kiya he yar kiya he ho bhaiya ap , ahse thore google mil giya concept isse kahte hai yarr ,,,, kasam se me ek video dekha ab me pura playlist dekhne walahu
In 180Degree roated array we also do this an bhaiya that we reverse the 2D-array Row elements as we do, and after that we swap the 2D-array rows,
logic:- if 2D-array of 2*2 then we reverse all 4row elements and we swap 0-row with 3-row and 1-row with 2-row
code:-
void rotate(vector& matrix) {
// Code here
int n = matrix.size();
// code of reverse row elements
for(int i=0; i
Understood Sir 🙇♂✨💖🙏
sach mei maza aagya thankyou so much god and also to you sir. for this course
transpose matrix by 90 degree method 2:-
#include
using namespace std;
int main() {
int arr[4][4] = {
{1, 2, 3, 4},
{5, 6, 7, 8},
{9, 10, 11, 12},
{13, 14, 15, 16}
};
for (int i = 0; i < 4; ++i) {
for (int j = i + 1; j < 4; ++j) {
swap(arr[i][j], arr[j][i]);
}
}
for (int i = 0; i < 4; ++i) {
int start = 0, end = 3;
while (start < end) {
swap(arr[i][start], arr[i][end]);
start++;
end--;
}
}
// Print the rotated matrix
for (int i = 0; i < 4; ++i) {
for (int j = 0; j < 4; ++j) {
cout
Bhaiya maja a gya Keep Making vidios for us 280 days😁😄😃😀
Your Explanation are too good bhaiya❤
40:39
for(int i=0;I
bhaiya bauth acche se samajh aaya aaj ka concept
Bhaiya Chamak gya ❤
understood very well
MAJA AA GAYA BHAIYA THANK YOU , AISE CONTAIINT DENE KE LIYE.🙏🙏
lecture 33 completed ♥
Chamka bhaiya 👍🏻
maza aa gaya bhai aaj to
complete 25% of chellenge
Yes 👍
matrix rotation by 180 degree( my approch )
class Solution {
public:
void rotate(vector& matrix) {
// Code here
int n=matrix.size();
int i=0,j=n-1,start=0,end=n-1;
while(i=end) break;
if(start==n)
{
i++;j--;
start=0;end=n-1;
}
}
}
};
Content quality 🔥
Bhaiya ko dhanyavaad❤
Jay Shree Ram🚩
Thank you
class Solution {
public:
void rotate(vector& matrix) {
// Code here
int n = matrix.size();
for(int i = 0; i < n-1; i++)
{
for(int j = i +1; j < n; j++)
{
swap(matrix[i][j], matrix[j][i]);
}
}
for(int i = 0; i < n; i++)
{
int start = 0, end = n-1;
while(start
Yes
maza aa gya bhaiya
thank u sir
before 46:39, I thought of this solution in different way.
//approach first we find transpose of the matrix
//reverse it by column
#include
using namespace std;
void reverseCol(int arr[][3]){//column wise reverse
for(int j=0;j
Day 45/180 done thanku bhaiya🙃
👍👍👍
8:53
int arr[4][4] = {{1,2,3,4},
{5,6,7,8},
{9,10,11,12},
{13,14,15,16}};
int v[4][4];
for(int i=0;i
Bhaiya what you are din it will not impact Today but defferent Tomorrow it will impact in coder community keep going ❤
yes,
chamak gya
Maza agya sir
Thanks Bhaiya...❤🎉
Lecture bahut aache se chamka hai hai bhaiya ❤❤
Day 45 complete
#180days coding challenge
#CoderArmy💪
Good morning 🌞
59:59
// Rotate matrix by k time
#include
using namespace std;
void Rotate90(int matrix[][4],int row,int col)
{
//transpose matrix
for(int i=0;i
Some problem they give same answer for any k number
i did like this
#include
using namespace std;
// brute force approach
void print(int arr[][4], int row, int col)
{
for (int i = 0; i < row; i++)
{
for (int j = 0; j < col; j++)
{
cout
Bhai k--; kyo kiya hn jab k ki value 3 hogi 3 times rotate karega but k-- se 3 se 2 se 1 6 baar rotate hoga phir@@prathmesh_Bidve
Good morning Bhai I was out due bad health issue .. from now I am going to give my 100 % again
❤❤❤❤
At 21:10 can I use for loop like
for(int I=0;i
Day 44/180 Completed ✅✅✅
Attendance Sir 🙏 Good morning Everyone
30:00
Jai Hind ❤
Day 45 ✅
Good Morning bhaiya ❤❤
Day45💕 completed
Good morning bhaiya.💖
Instead of swaping we can do matrix [ j ] [ I ]
Good morning Bhaiya 😊
49:40 yes
Good morning boss ❤
Day 33✅
Day 45/180 done ✅✅✅ # hard
Good morning negi bhai❤