program to find first non repeating element in c language?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

program to find first non repeating element in c language??

input :- swiss output:- w

14th Feb 2018, 1:23 PM
Nitin Chouhan
Nitin Chouhan - avatar
3 Answers
+ 4
without pointers (return 0 if no characters found) char repeat(char * s){ size_t i = 0, j = 0; while(s[i] && s[j]){ j = i + 1; while(s[j] && s[j] != s[i]){ j++; } ++i; } return s[i]; }
14th Feb 2018, 1:46 PM
Baptiste E. Prunier
Baptiste E. Prunier - avatar
+ 1
without using pointer??
14th Feb 2018, 1:32 PM
Nitin Chouhan
Nitin Chouhan - avatar