Skip to main content
Commonmark migration
Source Link

#Java 8, 117 115 bytes

Java 8, 117 115 bytes

s->{for(String x:s.split(" "))System.out.print((char)Long.parseLong(x.replace("Fizz","0").replace("Buzz","1"),2));}

I doubt you can do a lot of the fancy regex replacements in Java like most other answers, mainly because you can't do anything with the captured capture-groups in Java-regexes.. (I.e. "$1".charAt(...) or "$1".replace(...) aren't possible for example.)

Explanation:

Try it here.

s->{                          // Method with String parameter and no return-type
  for(String x:s.split(" "))  //  Loop over the input split by spaces:
    System.out.print(         //   Print:
     (char)                   //    Each character
     Long.parseLong(          //    after we've converted each binary-String to a long
      x.replace("Fizz","0").replace("Buzz","1")
                              //    after we've replaced the Fizz/Buzz to 0/1
     ,2));
}                             // End of method

#Java 8, 117 115 bytes

s->{for(String x:s.split(" "))System.out.print((char)Long.parseLong(x.replace("Fizz","0").replace("Buzz","1"),2));}

I doubt you can do a lot of the fancy regex replacements in Java like most other answers, mainly because you can't do anything with the captured capture-groups in Java-regexes.. (I.e. "$1".charAt(...) or "$1".replace(...) aren't possible for example.)

Explanation:

Try it here.

s->{                          // Method with String parameter and no return-type
  for(String x:s.split(" "))  //  Loop over the input split by spaces:
    System.out.print(         //   Print:
     (char)                   //    Each character
     Long.parseLong(          //    after we've converted each binary-String to a long
      x.replace("Fizz","0").replace("Buzz","1")
                              //    after we've replaced the Fizz/Buzz to 0/1
     ,2));
}                             // End of method

Java 8, 117 115 bytes

s->{for(String x:s.split(" "))System.out.print((char)Long.parseLong(x.replace("Fizz","0").replace("Buzz","1"),2));}

I doubt you can do a lot of the fancy regex replacements in Java like most other answers, mainly because you can't do anything with the captured capture-groups in Java-regexes.. (I.e. "$1".charAt(...) or "$1".replace(...) aren't possible for example.)

Explanation:

Try it here.

s->{                          // Method with String parameter and no return-type
  for(String x:s.split(" "))  //  Loop over the input split by spaces:
    System.out.print(         //   Print:
     (char)                   //    Each character
     Long.parseLong(          //    after we've converted each binary-String to a long
      x.replace("Fizz","0").replace("Buzz","1")
                              //    after we've replaced the Fizz/Buzz to 0/1
     ,2));
}                             // End of method
added 4 characters in body
Source Link
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384

#Java 8, 117117 115 bytes

s->{for(String x:s.split(" "))System.out.print((char)ShortLong.parseShortparseLong(x.replace("Fizz","0").replace("Buzz","1"),2));}

I doubt you can do a lot of the fancy regex replacements in Java like most other answers, mainly because you can't do anything with the captured capture-groups in Java-regexes.. (I.e. "$1".charAt(...) or "$1".replace(...) aren't possible for example.)

Explanation:

Try it here.Try it here.

s->{                          // Method with String parameter and no return-type
  for(String x:s.split(" "))  //  Loop over the input split by spaces:
    System.out.print(         //   Print:
     (char)                   //    Each character
     ShortLong.parseShortparseLong(          //    after we've converted each binary-String to ana integerlong
      x.replace("Fizz","0").replace("Buzz","1")
                              //    after we've convertedreplaced the Fizz/Buzz to 0/1
     ,2));
}                             // End of method

#Java 8, 117 bytes

s->{for(String x:s.split(" "))System.out.print((char)Short.parseShort(x.replace("Fizz","0").replace("Buzz","1"),2));}

I doubt you can do a lot of the fancy regex replacements in Java like most other answers, mainly because you can't do anything with the captured capture-groups in Java-regexes.. (I.e. "$1".charAt(...) or "$1".replace(...) aren't possible for example.)

Explanation:

Try it here.

s->{                          // Method with String parameter and no return-type
  for(String x:s.split(" "))  //  Loop over the input split by spaces:
    System.out.print(         //   Print:
     (char)                   //    Each character
     Short.parseShort(        //    after we've converted each binary-String to an integer
      x.replace("Fizz","0").replace("Buzz","1")
                              //    after we've converted the Fizz/Buzz to 0/1
     ,2));
}                             // End of method

#Java 8, 117 115 bytes

s->{for(String x:s.split(" "))System.out.print((char)Long.parseLong(x.replace("Fizz","0").replace("Buzz","1"),2));}

I doubt you can do a lot of the fancy regex replacements in Java like most other answers, mainly because you can't do anything with the captured capture-groups in Java-regexes.. (I.e. "$1".charAt(...) or "$1".replace(...) aren't possible for example.)

Explanation:

Try it here.

s->{                          // Method with String parameter and no return-type
  for(String x:s.split(" "))  //  Loop over the input split by spaces:
    System.out.print(         //   Print:
     (char)                   //    Each character
     Long.parseLong(          //    after we've converted each binary-String to a long
      x.replace("Fizz","0").replace("Buzz","1")
                              //    after we've replaced the Fizz/Buzz to 0/1
     ,2));
}                             // End of method
Source Link
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384

#Java 8, 117 bytes

s->{for(String x:s.split(" "))System.out.print((char)Short.parseShort(x.replace("Fizz","0").replace("Buzz","1"),2));}

I doubt you can do a lot of the fancy regex replacements in Java like most other answers, mainly because you can't do anything with the captured capture-groups in Java-regexes.. (I.e. "$1".charAt(...) or "$1".replace(...) aren't possible for example.)

Explanation:

Try it here.

s->{                          // Method with String parameter and no return-type
  for(String x:s.split(" "))  //  Loop over the input split by spaces:
    System.out.print(         //   Print:
     (char)                   //    Each character
     Short.parseShort(        //    after we've converted each binary-String to an integer
      x.replace("Fizz","0").replace("Buzz","1")
                              //    after we've converted the Fizz/Buzz to 0/1
     ,2));
}                             // End of method