- The submitted code needs one declared function main(```func main()```) even if empty.
- The submitted code needs one declared function main(```func main()```) even if empty.
- 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 testing 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
You have two numbers represented by a linked list, where each node contains a single digit.
You have two numbers represented by a linked list, where each NodeAddL contains a single digit.
The digits are stored in reverse order, such that the 1’s digit is at the head of the list.
The digits are stored in reverse order, such that the 1’s digit is at the head of the list.
Write a function that adds the two numbers and returns the sum as a linked list
Write a function that adds the two numbers and returns the sum as a linked list
- The submitted code needs one declared function main(```func main()```) even if empty.
- The submitted code needs one declared function main(```func main()```) even if empty.
- 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 testing 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
@ -18,42 +18,42 @@ Change order of linked list so that elements with odd index come first, elements
with even index come afterwards.
with even index come afterwards.
You have to return pointer/reference to the beginning of new list
You have to return pointer/reference to the beginning of new list
- The submitted code needs one declared function main(```func main()```) even if empty.
- The submitted code needs one declared function main(```func main()```) even if empty.
- 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 testing 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 two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not.
Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not.
- The submitted code needs one declared function main(```func main()```) even if empty.
- The submitted code needs one declared function main(```func main()```) even if empty.
- 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 testing 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
You are given an integer.
You are given an integer.
Your function must return sum of all prime numbers prior to the number exclusively. The number is not included.
Your function must return sum of all prime numbers prior to the number exclusively. The number is not included.
- The submitted code needs one declared function main(```func main()```) even if empty.
- The submitted code needs one declared function main(```func main()```) even if empty.
- 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 testing 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
@ -16,22 +16,23 @@ This means that:
You are given a linked list, where each node contains a single digit.
You are given a linked list, where each node contains a single digit.
Write a function that reverses the list and returns pointer/reference to new linked list
Write a function that reverses the list and returns pointer/reference to new linked list
### Expected function and struct
### Expected function and structure
```go
```go
package piscine
package main
type Node struct {
type NodeAddL struct {
Next *Node
Next *NodeAddL
Num int
Num int
}
}
func Reverse(node *Node) *Node {
func Reverse(node *NodeAddL) *NodeAddL {
}
}
```
```
### Usage
### Usage
Here is a possible program to test your function :
Here is a possible program to test your function :
- The submitted code needs one declared function main(```func main()```) even if empty.
- The submitted code needs one declared function main(```func main()```) even if empty.
- 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 testing 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 two binary trees, write a function to check if they are the same or not.
Given two binary trees, write a function to check if they are the same or not.
Two binary trees are considered the same if they are structurally identical and the nodes have the same value.
Two binary trees are considered the same if they are structurally identical and the nodes have the same value.
Write a function, `IsSameTree`, that returns bool.
Write a function, `IsSameTree`, that returns `bool`.