for question::Jadoo and Strings on hackerearth site

#include<bits/stdc++.h>
#include
using namespace std;

int main() {
    count=0;
    int arr[1000];
    for(int i=0;i<1000;i++){
    cin >>arr[i];
    count++;
    }
     for(int j=(count-1);j>0;j--)
     cout << arr[j];
    return 0;
}

I don’t think this is the code you intended to post i saw your submission in hacker earth (https://www.hackerearth.com/submission/17453419/) in this code you are taking the input as cin>>s; but cin only takes the input till first space like if the input is “abcd efgh” your string will be take input as “abcd” but not “abcd efgh” so your output will be “dcba” not “hgfe dcba” hence wrong ans try using getline(cin,s); i used that and got AC :slight_smile: