I could well imagine most interviewers today rejecting such a terse answer out of hand!
On 27 Mar 2014 15:37:31 -0400, Dan Bron <j...@bron.us> wrote: > A question on StackExchange [1]: > > " > I was asked the following interview question over the phone: > Given an array of integers, produce an array whose values > are the product of every other integer excluding the current index. > > Example: > [4, 3, 2, 8] -> [3*2*8, 4*2*8, 4*3*8, 4*3*2] -> [48, 64, 96, 24] > " > > His answer is given in the postscript. It spans 3 kilobytes over 86 lines. > The community's responses aren't much of an improvement (by that metric; > by other metrics - Java-specific ones, they decent advancements). > > The J answer? > > 1 */\. 4 3 2 8 > 48 64 96 24 > > Could've answered the interviewer in a sentence, right over the phone. > > -Dan > > > [1] Code Review StackExchange question > "Array whose values are the product of every other integer": > > http://codereview.stackexchange.com/questions/45498/array-whose-values-are-the-product-of-every-other-integer —— Murray Eisenberg mur...@math.umass.edu Mathematics & Statistics Dept. Lederle Graduate Research Tower phone 240 246-7240 (H) University of Massachusetts 710 North Pleasant Street Amherst, MA 01003-9305 ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm