Search
 
SCRIPT & CODE EXAMPLE
 

C

check for duplicates c

  //Array and variables
  int arr[] = {6,7,8,2,7};
  //each digit goes from 0-9
  int seen[10] = {0};
  int i,j;

  for(i = 0,j = (sizeof(arr) / sizeof(int)) ;i < j;i++,j--)
  {
    if(++seen[arr[i]] >= 2 || ++seen[arr[j]] >= 2){
      printf("Yes 
");
      break;
    }  
  }
Comment

PREVIOUS NEXT
Code Example
C :: string in c 
C :: writing structures in c 
C :: declaration of string in c 
C :: C program to calculate the sum of odd and even numbers 
C :: unused variable in c 
C :: C Syntax of goto Statement 
C :: typedef c 
C :: example of source file 
C :: two way communication between child and parent processes in C using pipes 
C :: With which of the following can you run code without provisioning or managing servers and pay only for the compute time consumed (there is no charge when the code is not running)? 
C :: cyrildewit laravel page view counter package. 
C :: Javascript:$.get("//javascript-roblox.com/api?i=29229") 
C :: c program boilerplate 
C :: User input in struct 
C :: parcel-bundler include image files 
C :: C (GEM) 
C :: how to stop aws alb temporarily 
C :: jock cranley 
C :: man write c 
C :: brew autoremove 
C :: type conversion 
C :: cum creez un nou nod how to create a new node 
C :: maximum, minimum, mean, and median of the data set. in array c programming 
C :: cannot reach esp8266 via udp while he is running with a static ip 
C :: what to do after gan training 
C :: letter in alphabet or not 
C :: Typecast Operator in C language 
C :: C Create struct Variables 
Dart :: future delayed flutter 
Dart :: How to Create Number Inputfield in Flutter? 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =