Skip to content

Latest commit

 

History

History
20 lines (16 loc) · 422 Bytes

README.md

File metadata and controls

20 lines (16 loc) · 422 Bytes

win-a-book

Crazy questions for crazy developers

Maximum without comparators

Write a function that takes 2 integers and returns the greater of them, or one of them if they are equal. You should not use comparators such as >, <, ==, Math.Max(), if, then, else, switch and the like.

Example:

Max(0, 0) => 0
Max(10, 0) => 10
Max(0, 10) => 10
Max(-1, 0) => 0
Max(-1, 1) => 1
Max(-10, -1) => -1