C. Not Adjacent Matrix | D. Same Differences | Codeforces Round

  Рет қаралды 3,887

code Explainer

code Explainer

Күн бұрын

Пікірлер: 30
@VishalYadav-gk1kg
@VishalYadav-gk1kg 9 ай бұрын
Very nice explanation!, Thank you!
@codeExplainer
@codeExplainer 9 ай бұрын
Glad it was helpful!
@Marcelo-yp9uz
@Marcelo-yp9uz 3 жыл бұрын
thank you so much!
@codeExplainer
@codeExplainer 3 жыл бұрын
Glad it helped!
@x_x3557
@x_x3557 3 жыл бұрын
for(int i=0; i= 1) count += mp[ arr[i] - i ]; mp[ arr[i] - i ] ++; } I am getting the right answer even with this
@lakshyachhangani1056
@lakshyachhangani1056 3 жыл бұрын
In c question simple sol . I just printed the first n odd numbers in a row and then printed all even numbers in a row for eg 1 3 5 7 9 11 13 15 2 4 6 8 10 12 14 16
@codeExplainer
@codeExplainer 3 жыл бұрын
nice observation.
@Advebtures-hx4hv
@Advebtures-hx4hv Жыл бұрын
My solution likes you bro 🥰
@akshay7047
@akshay7047 3 жыл бұрын
My Solution : Just add N to every next index in circular loop start with 1 . for next iteration take (2nd value of previous line + 1) and again increment by N eg for 3 : 1 4 7 5 8 2 9 3 6 here for 2nd line I have increamented it from 2nd valu of first line i.e. 4 so next line will start with 4+1 = 5
@akshay7047
@akshay7047 3 жыл бұрын
code (c++ ): #include using namespace std; int main() { int len; cin >> len; int count; while (len--) { cin >> count; int ans[count][count] = {}; if (count == 2) { cout
@codeExplainer
@codeExplainer 3 жыл бұрын
nice logic..
@its_neel_ok
@its_neel_ok Жыл бұрын
i solved like this -- void solv(){ int n;cin>>n; if(n==2){ cout
@ajaib1313
@ajaib1313 3 жыл бұрын
E was also easy , we can take * as 1 and . as 0 , so we obtain a binary string , the problem reduces to finding min no of adjacent swaps to group all ones together , it's available in stack overflow 🎉
@codeExplainer
@codeExplainer 3 жыл бұрын
oohh nice..
@ishankbansal9239
@ishankbansal9239 3 жыл бұрын
I have done C in very lengthy way I have filled the consecutive values daigonally
@codeExplainer
@codeExplainer 3 жыл бұрын
yes , nice observation.
@SoumyajitMondal
@SoumyajitMondal 3 жыл бұрын
Can't we do D without Map consept ??
@satishprajapati1684
@satishprajapati1684 3 жыл бұрын
your CF handle ?
@codeExplainer
@codeExplainer 3 жыл бұрын
codeExplainer
@pushpaksambhe7405
@pushpaksambhe7405 3 жыл бұрын
Bhaiyya code for problem D I saw u was messing around it!! Anyways contest was good.. void solve(){ int n;cin>>n;int a[n+1]; unordered_mapm; for(int i=1;i>a[i]; m[i-a[i]]++; } int ans=0; for(auto i:m) ans+=i.second*(i.second-1)/2; cout
@sanskarkumar7984
@sanskarkumar7984 3 жыл бұрын
C explanation was really good. I thought of a very lengthy code 😅😅😅. Solved 4 in the first hour.
@codeExplainer
@codeExplainer 3 жыл бұрын
Great job!
@aaravbhardwaj8065
@aaravbhardwaj8065 3 жыл бұрын
bhaiya ess question pe video bando pls LEETCODE: 1851. Minimum Interval to Include Each Query
@sumitmukharjee5816
@sumitmukharjee5816 3 жыл бұрын
bhaiyya how u come up with such logics I was only able to solve 1st two question in 1 hour
@codeExplainer
@codeExplainer 3 жыл бұрын
practice
@19csead17
@19csead17 3 жыл бұрын
Bro talk in hindi, my ears were bleeding after hearing this!
@codeExplainer
@codeExplainer 3 жыл бұрын
sometimes it happens , i am not to good in fluent English , but i am trying.
@mohitmalik4610
@mohitmalik4610 3 жыл бұрын
bhai english bolke angreez nhi bn jayga , hindi me ache se smjha payga plz use hindi
@codeExplainer
@codeExplainer 3 жыл бұрын
bhai bhut channel hindi mei banate hai vaha se dekhle..
@pushpaksambhe7405
@pushpaksambhe7405 3 жыл бұрын
@@codeExplainer patt se head shot😂 When they will face interview then they will try to watch every explaination in english
Perfect Pitch Challenge? Easy! 🎤😎| Free Fire Official
00:13
Garena Free Fire Global
Рет қаралды 85 МЛН
Walking on LEGO Be Like... #shorts #mingweirocks
00:41
mingweirocks
Рет қаралды 7 МЛН
Motorbike Smashes Into Porsche! 😱
00:15
Caters Clips
Рет қаралды 23 МЛН
you will never ask about pointers again after watching this video
8:03
5 Simple Steps for Solving Any Recursive Problem
21:03
Reducible
Рет қаралды 1,2 МЛН
Same Differences | Map | Problem D | Codeforces Round 719 Div3
7:44
CodeWithSunny
Рет қаралды 3,7 М.
The Quest To Make Unbreakable Glass
22:23
Veritasium
Рет қаралды 2,2 МЛН
A. K-divisible Sum | Educational Codeforces Round 103 | BITS PILANI
9:19
Same Differences [CodeForces - 1520D] - Solution Approach
20:02
Sandeep Kumar
Рет қаралды 1,1 М.
Object-Oriented Programming is Embarrassing: 4 Short Examples
28:03
Brian Will
Рет қаралды 2,1 МЛН
Perfect Pitch Challenge? Easy! 🎤😎| Free Fire Official
00:13
Garena Free Fire Global
Рет қаралды 85 МЛН