thanks for the quick respond... I knew it will raise more question so let me give some example for instance
41 25 347 352 24 57 24 -12 64 32 25 43 12 41 25 - is our array
k lets say is 5 what leads to 15/5=3 we have number "25" so
25 should be returned
another one
-3 23 12 64 23 12 12 -3 23 = array.length =9
k=3 so 9/3=3 23/12 should be returned.
"So what have you tried and what specifically are you having trouble with? – Chris Dunaway" trouble will lets say that we all know how to make it in o(n) but how to make it by running over the array only twice :(
"By "repeat itself," do you mean it should be a consecutive run of the same number?" same number :) see examples above please.
"Constant memory per array, or constant memory per element?" dont understand the question :( sorry
"Sorry, I read the "constant memory" requirement as being a "bonus marks" question... :-) " as a matter of fact it's a bonus question the memory requirement.