for(int i=0; i= 1) count += mp[ arr[i] - i ]; mp[ arr[i] - i ] ++; } I am getting the right answer even with this
@lakshyachhangani10563 жыл бұрын
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
@codeExplainer3 жыл бұрын
nice observation.
@Advebtures-hx4hv Жыл бұрын
My solution likes you bro 🥰
@akshay70473 жыл бұрын
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
@akshay70473 жыл бұрын
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
@codeExplainer3 жыл бұрын
nice logic..
@its_neel_ok Жыл бұрын
i solved like this -- void solv(){ int n;cin>>n; if(n==2){ cout
@ajaib13133 жыл бұрын
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 🎉
@codeExplainer3 жыл бұрын
oohh nice..
@ishankbansal92393 жыл бұрын
I have done C in very lengthy way I have filled the consecutive values daigonally
@codeExplainer3 жыл бұрын
yes , nice observation.
@SoumyajitMondal3 жыл бұрын
Can't we do D without Map consept ??
@satishprajapati16843 жыл бұрын
your CF handle ?
@codeExplainer3 жыл бұрын
codeExplainer
@pushpaksambhe74053 жыл бұрын
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
@sanskarkumar79843 жыл бұрын
C explanation was really good. I thought of a very lengthy code 😅😅😅. Solved 4 in the first hour.
@codeExplainer3 жыл бұрын
Great job!
@aaravbhardwaj80653 жыл бұрын
bhaiya ess question pe video bando pls LEETCODE: 1851. Minimum Interval to Include Each Query
@sumitmukharjee58163 жыл бұрын
bhaiyya how u come up with such logics I was only able to solve 1st two question in 1 hour
@codeExplainer3 жыл бұрын
practice
@19csead173 жыл бұрын
Bro talk in hindi, my ears were bleeding after hearing this!
@codeExplainer3 жыл бұрын
sometimes it happens , i am not to good in fluent English , but i am trying.
@mohitmalik46103 жыл бұрын
bhai english bolke angreez nhi bn jayga , hindi me ache se smjha payga plz use hindi
@codeExplainer3 жыл бұрын
bhai bhut channel hindi mei banate hai vaha se dekhle..
@pushpaksambhe74053 жыл бұрын
@@codeExplainer patt se head shot😂 When they will face interview then they will try to watch every explaination in english