Tuesday, 23 September 2014

Hackerrank Service lane solution

The Solution for hackerrank problem, Service Lane using C Program.
Passed Test cases: 11 out of 11

SOURCE CODE:


 #include<stdio.h>  
 int main()  
   {  
   unsigned int n, t;  
   int width[100000],i;  
   scanf("%u %u",&n,&t);  
   for(i=0;i<n;i++)  
     {  
     scanf("%d",&width[i]);  
   }  
   while(t--)  
     {  
     int k,l,m,n;  
     scanf("%d %d",&k,&l);  
     n= width[k];  
     for(m=k;m<=l;m++){  
       if(n>width[m])  
         {  
         n = width[m];  
       }  
     }  
     printf("%d\n",n);  
   }  
   return 0;  
 }  

1 comment:

  1. Hackerrank Service lane solution is the best solution which is here for the readers. As a reader i would like to tell other about this blog. This is a special blog for uni assignment help developers.

    ReplyDelete