Sort by

recency

|

32 Discussions

|

  • + 0 comments

    I think it should be like this, then you should understand: After doubling the second pile, the happiness factor becomes 6 ; this is maximal, because the happiness factor would remained at 6 if Alice now chose any of the piles to double.

  • + 0 comments

    Can anyone explain this testcase input: 9. 10 4 10 20 20 30 30 7 8. output: 7 1

  • + 0 comments
    int n,x,y=0; 
        scanf("%d",&n);
        int *point =(int*)malloc(sizeof(int) * n);
        for(int i = 0; i < n; i++){
           scanf("%d",&point[i]);
            if(point[i]>=point[i+1])
                {
                x=point[i];
                point[i]=point[i+1];
                point[i+1]=x;}
        }
                
                    for(int i = 0; i < n; i++)  {
                     if(point[i]=point[i+1])
                         {y=y+1;
                         }
                 }
            
           
               
               printf("%d %d",point[0]*2,y);
    

    CAN ANYBODY TELL ME WHAT IS THE PROBLEM IN THIS CODE

  • + 0 comments

    I can't understannd this ques plz explain in java guys

  • + 0 comments

    @Teamhackerrank TC #3 and #7 have wrong outputs please correct them.