[space] refers to
[tab] refers to
[LF] refers to
"\n" for illustrative purposes. This does not mean that you can use these placeholders in your solution.
In esoteric language called Whitespace, numbers are represented in the following format:
- first character represents the sign:
- characters after that and until
[LF]are the binary representation of the integer:
- characters after that are the binary representation of the absolute value of the number, with
[tab]for 1, the rightmost bit is the least significand bit, and no leading zero bits.
- the binary representation is immediately followed by
- Valid Whitespace number must always have at least two characters: a sign and the terminator. In case there are only two characters, the number is equal to zero.
- For the purposes of this challenge, zero must always be represented as
- In Whitespace, only space, tabulation and linefeed are meaningful characters. All other characters are ignored. However, for the purposes of this simple challenge, please do not add any other characters in the output.
- In this challenge, input will always be a valid negative or positive integer.
- For your convenience, in this challenge we will use
unbleach()function when evaluating your results. This function replaces whitespace characters with
[LF]to make fail messages more obvious. You can see how it works in Example Test Cases.
1in Whitespace is
- `` in Whitespace is
-1in Whitespace is
2in Whitespace is
" \t \n".
-3in Whitespace is
The solution in Python code
Test cases to validate our solution