package UE00_Other.MEDT;

import java.util.ArrayList;
import java.util.List;

public class Plakat_CODING_Contest {

                static final String participation_fee = "20€";
                static final String grand_prize = "Macbook Pro M4";

                public static List<Integer> generateFibonacci(int length) {
                                List<Integer> sequence = new ArrayList<>();
                                int a = 0, b = 1;
                                while (sequence.size() < length) {
                                                sequence.add(a);
                                                int temp = a;
                                                a = b;
                                                b = temp + b;
                                }
                                return sequence;
                }
                public static List<Integer> generateRandomNumbers(int count) {
                                List<Integer> numbers = new ArrayList<>();
                                for (int i = 0; i < count; i++) numbers.add((int) (Math.random() * 100) + 1);
                                return numbers;
                }
                public static int sumPrimes(List<Integer> numbers) {
                                int sum = 0;
                                for (int number : numbers) if (isPrime(number)) sum += number;
                                return sum;
                }
                public static boolean isPrime(int number) {
                                if (number <= 1) return false;
                                for (int i = 2; i <= Math.sqrt(number); i++) if (number % i == 0) return false;
                                return true;
                }
                static void depthFirstSearch(Node node, List<Node> visited) {
                                if (node == null || visited.contains(node)) return;
                                System.out.println("Visited: " + node.name);
                                visited.add(node);
                                for (Node neighbor : node.neighbors) depthFirstSearch(neighbor, visited);
                }
                static class Node {
                                String name;
                                List<Node> neighbors;
                                Node(String name) {
                                                this.name = name;
                                                this.neighbors = new ArrayList<>();
                                }
                                void addNeighbor(Node neighbor) {
                                                neighbors.add(neighbor);
                                }
                }
}