Тёмный
No video :(

Queen's Attack II | HackerRank Solution | Hindi c++ 

Farjee Guruji
Подписаться 494
Просмотров 2,6 тыс.
50% 1

In this video we will see theapproach to solveNumber of cells a queen can move with obstacles on the chessborad:-
www.hackerrank...
Entire Playlist on LeetCode:-
/ @farjeeguruji2057
CP Playlist on Channel:-
• Competitive Programmin...
.x.x.x.x.x.x.x.x.LINE OF LINKS .x.x.x.x.x.x.x.x.
Personal RU-vid ► / kid09
Instagram► / gauravmandal09
Twitter ► / gauravmandal09
Facebook ► / gauravmandal09
'BOT ME-
My Name is Gaurav Mandal aka Farjee Guruji.
Here I upload stuff Related to the Tech.
Jai Hind, India Is Love

Опубликовано:

 

22 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 15   
@shashankmaheshwari3067
@shashankmaheshwari3067 3 года назад
WAAH YAAR MAZE AAGAYE
@anuragnema4423
@anuragnema4423 2 года назад
Solution without using Graph - int attackcount = 0; int left = c_q - 1, right= n - c_q; int up = n - r_q, down = r_q - 1; int upleft = min(up,left),upright = min(up,right); int downleft = min(down,left),downright = min(down,right); for(int i = 0;i obstacles[i][0] && c_q == obstacles[i][1]){ down = min(down,r_q - obstacles[i][0] -1); } else if(r_q == obstacles[i][0] && c_q > obstacles[i][1]){ left = min(left,c_q-obstacles[i][1]-1); } else if(r_q == obstacles[i][0] && c_q < obstacles[i][1]){ right = min(right,obstacles[i][1]-c_q-1); } else if(r_q < obstacles[i][0] && c_q>obstacles[i][1]){ if(abs(r_q - obstacles[i][0])==abs(c_q-obstacles[i][1])){ upleft = min(upleft,obstacles[i][0]-r_q-1); } } else if(r_q obstacles[i][1]){ if(abs(r_q - obstacles[i][0])==abs(c_q-obstacles[i][1])){ downleft = min(downleft,c_q-obstacles[i][1]-1); } } else if(r_q > obstacles[i][0] && c_q < obstacles[i][1]){ if(abs(r_q - obstacles[i][0])==abs(c_q-obstacles[i][1])){ downright = min(downright,obstacles[i][1]-c_q-1); } } } attackcount = (up + down + left + right + upleft + upright + downleft + downright); return attackcount;
@adarshchoudhary7149
@adarshchoudhary7149 2 года назад
thanks alot sir
@kiyoutakaayanokouji3701
@kiyoutakaayanokouji3701 3 месяца назад
nc bro
@akashyadav3211
@akashyadav3211 2 года назад
Solved it just using one for loop 💀
@dheepakraaj8352
@dheepakraaj8352 3 года назад
excellent explanation sir and iam from tamilnadu south east xD :)
@ujjwalshirpurkar1612
@ujjwalshirpurkar1612 3 года назад
i am so naive... i didn't knew this question uses graph concepts .. so i solved it by using 8 while loops 10 for loops 16 if else conditions i don't even remember exact count LOL....after this much struggle i feared of time limit and as i thought it failed in 3/21 test cases.....time exceeded
@farjeeguruji2057
@farjeeguruji2057 3 года назад
😂 thats sick fam
@adityaprasadsinha6697
@adityaprasadsinha6697 2 года назад
@@farjeeguruji2057 same happened wid me 😂
@ashishpradhan01
@ashishpradhan01 2 года назад
@@adityaprasadsinha6697 I solved this question using 8 while loops. Without taking any stack space.
@ongoclong6875
@ongoclong6875 2 года назад
thank you so much. i have 1 question that why in line 32 and 33, i code (x = obstacles) not equal (int x = obstacles); the diffrent is ( int ) but i don't know why it is??
@adityajha4275
@adityajha4275 2 года назад
map ke jagah pe unordered map use kyu nhi kr skte
@gauravmandal09
@gauravmandal09 2 года назад
Bilkul use kr skte hai unordered_map Aditya bhaai.
@rakesh1147
@rakesh1147 Год назад
unordered_maps pair ke liye work nahi karthe bhai!!
@asitkumar3164
@asitkumar3164 Год назад
@@rakesh1147 acha chutiye
Далее
Organizing Containers of Balls | Hackerrank | C++
20:15
When I met the most famous Cristiano
01:03
Просмотров 22 млн
Queen's Attack II | HackerRank (JavaScript)
27:41
Просмотров 1,4 тыс.
Greedy Florist | Hackerrank Solution | Hindi CPP
10:07
Просмотров 1,2 тыс.
Winning Facebook (Meta) Hacker Cup Qual Round 2022?
53:55
Scammed selling my MacBook, almost
15:09
Просмотров 43 тыс.
Chess Coding Problem-Queen Moves
13:24
Просмотров 7 тыс.
Templates in C++
17:58
Просмотров 587 тыс.
ACM ICPC Team HackerRank Solution
19:08
Просмотров 11 тыс.
Queen's Attack 2 HackerRank Solution Step by Step
36:14
Think Fast, Talk Smart: Communication Techniques
58:20
When I met the most famous Cristiano
01:03
Просмотров 22 млн