Ashutosh kumar (@ashutoshku93588) 's Twitter Profile
Ashutosh kumar

@ashutoshku93588

CSE-27||MERN STACK DEVELOPER||
DSA-C++

ID: 1775068411896455168

linkhttps://www.linkedin.com/in/ashutosh-kumar-84b24b285/ calendar_today02-04-2024 07:52:23

1,1K Tweet

839 Takipçi

2,2K Takip Edilen

Ashutosh kumar (@ashutoshku93588) 's Twitter Profile Photo

#Group anagram #Map Method 1 map<string, vector<string>>mp; Method 2->using hash map as a key of map 1 st time. map<std::array<int,256>,vector<string>>mp; Making function of hash map first time .

#Group anagram
#Map
Method 1
map&lt;string, vector&lt;string&gt;&gt;mp;
Method 2-&gt;using hash map as a key of  map 1 st time.
map&lt;std::array&lt;int,256&gt;,vector&lt;string&gt;&gt;mp;
Making function of hash map first time .
Ashutosh kumar (@ashutoshku93588) 's Twitter Profile Photo

Q-> 12 Integer to Roman Here I learn that we use push_back to insert a single character to an empty string or a vector for ans To push a string inside an empty string we use append function Like ans.append(Roman symbol [i]); Or ans+=RomanSymbol[i] ' ' store character " " Str

Q-&gt; 12 Integer to Roman 
Here I learn that we use push_back to insert a single character to an empty string or a vector for ans 
To push a string inside an empty string we use append function 
Like ans.append(Roman symbol [i]);
Or ans+=RomanSymbol[i]
' ' store character 
" " Str
Ashutosh kumar (@ashutoshku93588) 's Twitter Profile Photo

Q 51 N-Queens Use of map. #Backtracking Putting a string into a tempvector and consequently putting that temporary vector into a 2D string vector. See how efficiently and clearly isSafe() function is used. Unordered_map<int,bool>mp is used Int -> represent the index of board .

Q 51 N-Queens
Use of map.
#Backtracking 
Putting a string into a tempvector and consequently putting that temporary vector into a 2D string vector.
See how efficiently and clearly isSafe() function is used.
Unordered_map&lt;int,bool&gt;mp is used
Int -&gt; represent the index of board .
Ashutosh kumar (@ashutoshku93588) 's Twitter Profile Photo

Rat in a maze problem 1 #gfg Be aware about visited matrix,inialise all the cell of visited matrix by false. 3 conditions to move forward 1-> check boundary conditions 2->check visited condition 3->maze[0][0]==1 or 0

Rat in a maze problem 1
#gfg
Be aware about visited matrix,inialise all the cell of visited matrix by false.
3 conditions to move forward
1-&gt; check boundary conditions 
2-&gt;check visited condition 
3-&gt;maze[0][0]==1 or 0
Ashutosh kumar (@ashutoshku93588) 's Twitter Profile Photo

Q->79 Word Search similar to rat in a maze, be careful that in every function call we have return true, i was making mistake in this many times. 3rd boundary condition is different from rat in maze. if(word[ks]!=board[newx][newy]) return false;

Q-&gt;79 Word Search
similar to rat in a maze, be careful that in every function call we have return true, i was making mistake in this many times.
3rd boundary condition is different from rat in maze.
if(word[ks]!=board[newx][newy]) return false;
Ashutosh kumar (@ashutoshku93588) 's Twitter Profile Photo

Q->876 find middle node of linked list if(fast==NULL || fast->next==NULL) return slow; fast==NULL->this condition is useful when the length of linkedlist is even. fast->next==NULL->when length is odd.

Q-&gt;876
find middle node of linked list
if(fast==NULL || fast-&gt;next==NULL) return slow;
fast==NULL-&gt;this condition is useful when the length of linkedlist is even.
fast-&gt;next==NULL-&gt;when length is odd.
Ashutosh kumar (@ashutoshku93588) 's Twitter Profile Photo

Q->243 Palindrome Linked-List 1->solve func. is finding the middle of linked list (either even / odd len). ex=> 1->2->3->2->1 0/p=>3->2->1 reverse function reverses this 3->2->1 o/p=>1->2->3 similarly for even length. at last comparing mid ke pahle wali string and reverse wali

Q-&gt;243
Palindrome Linked-List
1-&gt;solve func. is finding the middle of linked list (either even / odd len).
ex=&gt;  1-&gt;2-&gt;3-&gt;2-&gt;1
0/p=&gt;3-&gt;2-&gt;1
reverse function reverses this  3-&gt;2-&gt;1
o/p=&gt;1-&gt;2-&gt;3
similarly for even length.
at last comparing mid ke pahle wali string and reverse wali
Ashutosh kumar (@ashutoshku93588) 's Twitter Profile Photo

Q->141 Linked List Cycle map is creating between adress of node(pointer) and its occurence(frequency). sir has made mapping of pointer and bool. I have mapped pointer to its occurence. optimized solution by mouse and rabbit (fast and slow) technique.

Q-&gt;141 Linked List Cycle map is creating  between adress of node(pointer) and its occurence(frequency). sir has made mapping of pointer and bool. I have mapped pointer to its occurence.
optimized solution by mouse and rabbit (fast and slow) technique.
Ashutosh kumar (@ashutoshku93588) 's Twitter Profile Photo

#loveBabbar Add 1 to a Linked List Number learnt a new method to create a new node by inserting numerical value. if(carr!=0 && back->next==NULL) { Node* newnode = new Node(carr); back->next = newnode; }

#loveBabbar
Add 1 to a Linked List Number
learnt a new method to create a new node by inserting numerical value.
if(carr!=0 &amp;&amp; back-&gt;next==NULL)
            {
                Node* newnode = new Node(carr);
                back-&gt;next = newnode;
                
            }