News for hackers. Stuff that matters.
Re:Fizz Buzz in Tensorflow by wrsh07 on Tuesday May 24, 2016 @10:24AM (#11761749)
One of my friends failed an interview out of college where they asked him fizz buzz, and [using python] he created an array [list(range(1,101))] and then overwrote multiples of 3 with "fizz" multiples of 5 with "buzz" and multiples of 15 with "fizzbuzz."

Because it was an unconventional solution, the interviewer didn't like it.

Re:Fizz Buzz in Tensorflow by alimw on Tuesday May 24, 2016 @12:26PM (#11762886)
That's exactly how I'd do it! What's supposed to be the better way? Modulo/division by three and five?
Re:Fizz Buzz in Tensorflow by jedberg on Thursday May 26, 2016 @01:47AM (#11775820)

    for x in xrange(1,101):
        if not x % 3:
            print "Fizz",
        if not x % 5:
            print "Buzz",
        if (x % 3) and (x % 5):
            print x
        else:
            print ""
Re:Fizz Buzz in Tensorflow by curiousgal on Wednesday May 25, 2016 @05:08AM (#11768545)
>Modulo/division by three and five?

And fifteen.

Re:Fizz Buzz in Tensorflow by _betty_ on Wednesday May 25, 2016 @04:39AM (#11768450)

  for(var i = 1; i <= 100; i++) {
    a[fizz +=3] = "fizz" + (a[fizz] || "");
    a[buzz +=5] = "buzz";
    print(a[i] || i);
  }