Can't figure out the mistake in return values


#1

Can anyone help me find the mistake I might be doing here.
input: 14 83 188 253 281 254 56 70 3 276 233 280 224 16 173 183 193 44 184 33 213 134 95 213 48 300 62 237 63

expected return: 83 281 188 173 253 0 281 254 254 281 56 281 70 0 3 56 276 281 233 281 280 83 224 253 16 16 173 281

my return value: 83 281 188 173 253 0 281 254 254 281 56 281 70 0 3 56 276 281 233 281 280 0 224 253 16 16 173 281


#2

7 th element from end in vary. your answer is 0 but answer is 83


#3

Just Check For the case when random ptr is NULL … :slight_smile: