Okay this logic ok when you don't need output in ordered way.. means 112234 ->1234 ..but what if input is 123231..will get unordered output ->321 ...but actual order we want is-> 123
Here's my c++ code: #include using namespace std; int main() { int arr[]={1,2,3,5,5,6,7,7,8};//sort it before delete duplicates vector v; int j=0; for(int i=0;i
Very easy to understand ...
After explaining , kindly display the coding also sir
Superb explanation 👌👌
presentation was super cool
Great explanation thanks
After seeing your videos, I'm Addicted to coding which I never liked before..
Very nice explanation
Wooooow
Okay this logic ok when you don't need output in ordered way.. means 112234 ->1234 ..but what if input is 123231..will get unordered output ->321 ...but actual order we want is-> 123
You are really great bro
simplest ans is store the array in map and display .first because map always gives the unique values( by the way nice way of teaching )
its better to use set
Time complexity and space complexity increases if we use set or map
This will only work if duplicate is just the next one what about duplicates are at random index ?
Very nice
This helped me think through a problem for my job… and I feel like it was quite helpful.
Thanks, dude in the video!!
Glad it helped!
I am your fan
What if the duplicate value is a different index like one is 2 index and second one is Last index so how can compare these different index values
First u can sort the elements
What happens if the last element was 1 instead of 5🤔
It's a sorted array, so the last element has to be 4 or more than 4.
What if 2 and 2 are not present adjacent to each other same for 4 ,4
it's a sorted array
Thanks bro ☺️
Welcome 😊
But ar2 will have 2 spaces left so garbage value will occupy it!!!!! So how to avoid this problem?! Please answer 😅❤
he has explained it in this video, ruclips.net/video/I0vmCnkcGW4/видео.html
simply perform XOR operstion
How to remove without using extra space?
he has explained it fully in this video ruclips.net/video/I0vmCnkcGW4/видео.html
using hashmap
Hashmaps Will take o(n) Space complexity
This is only for the sorted array… please correct your title or say in video that it works only for sorted array
Exactly !
👏🏻
What if 1 duplicate is at last it doesn't work
Source code..
We can solve Without using Additional array
How bro
Please tell me how to remove duplicate from {1,2,2,3,1,4,4} this array...
Sir aapki movement mujhe ladki ki tarah kyu lag rahi hai 👀🥲
Agar dublicate item 2nd or 5th position per ho to ye trick ki to waat lag jaegi
😂😂
Like comment for ans
are bhain sorted array hota hain sahi se padhle
You'll have to sort the array before you find unique elements
nij padariya ne tamari chatvi chhe
gujrati ma bolne bhai indian thai english ne mahtv deso jay rajiv dixit
What if in case of 1 2 2 3 2 4 4 5 ?😂
he already said after sorting array
Pgm pls
But what if there is a duplicate element occuring more than 1 Time?
Here's my c++ code:
#include
using namespace std;
int main()
{
int arr[]={1,2,3,5,5,6,7,7,8};//sort it before delete duplicates
vector v;
int j=0;
for(int i=0;i
wrong explanation
Where is the code??
Logic is explained here.