Write a program that takes a two integer as argument and displays the chess desk, where white cells`' '` and black cells `'#'`.
Write a program that takes two integers as arguments and displays the chess desk, in which white cells are represented by`' '` and black cells by`'#'`.
- If the number of arguments is different from 2, or if the argument is not a positive number, the program displays `Error` followed by a newline (`'\n'`).
- If the number of arguments is different from 2, or if the argument is not a positive number, the program displays `Error` followed by a newline (`'\n'`).
@ -7,7 +7,8 @@ There is a robot at position (0, 0) at 2D map.
Write a program, that outputs `true` if robot ends up at the origin (0, 0) after a sequence of moves, otherwise `false`. `\n` should be in the end of line.
Write a program, that outputs `true` if robot ends up at the origin (0, 0) after a sequence of moves, otherwise `false`. `\n` should be in the end of line.
Sequence of moves is a string, which characters state for movement direction:
Sequence of moves is a string, which characters state for movement direction:
- U - up
- U - up
- D - down
- D - down
- R - right
- R - right
- L - left
- L - left
@ -17,13 +18,13 @@ If the number of arguments is not 1, output `\n`.
### Usage
### Usage
```console
```console
$> go build
student@ubuntu:~/[[ROOT]]/test$ go build
$> ./main "UD"
student@ubuntu:~/[[ROOT]]/test$ ./main "UD"
true
true
$> ./main "LL"
student@ubuntu:~/[[ROOT]]/test$ ./main "LL"
false
false
```
```
In first case, the robot moves up and the down. So, it returned back to its origin position.
In first case, the robot moves up and the down. So, it returned back to its origin position.
In second example, the robot moves twice to the left. It is 2 positons left from its origin. So, program should output false.
In second example, the robot moves twice to the left. It is 2 positions left from its origin, so the program outputs false.
- The function main declared needs to **also pass** the `Restrictions Checker`(illegal functions tester). It is advised for the student to just empty the function main after its own testings are done.
- The function main declared needs to **also pass** the `Restrictions Checker`(illegal functions tester). It is advised for the student to just empty the function main after its own testings are done.
- Every other rules are obviously the same than for a `program`.
- Every other rules are obviously the same than for a `program`.
### Instructions:
### Instructions
Given an array of integers, return indices of the two numbers such that they add up to a specific target.
Given an array of integers, return indexes of the two numbers such that they add up to a specific target.
If there are more than one solution, return the first one.
If there are more than one solution, return the first one.
If there are no solutions, return nil.
If there are no solutions, return nil.
Expected function:
Expected function :
```go
```go
func TwoSum(nums []int, target int) []int {
func TwoSum(nums []int, target int) []int {
}
}
```
```
Here is a possible [program](TODO-LINK) to test your function :
Here is a possible [program](TODO-LINK) to test your function :