Skip to main content
1 of 2
lyxal
  • 35.6k
  • 2
  • 69
  • 148

Keg, 6 bytes

21½Ë/ℤ 

Try it online!

This defines the function f as:

  • Taking a single parameter, then
  • Calculating the square root of 2 by raising it to the power of 0.5, then
  • Dividing the parameter by root 2, then
  • Casting the result to an integer (truncating / flooring the result) and returning it.

The footer is to define the test cases in a nice way.

lyxal
  • 35.6k
  • 2
  • 69
  • 148