Code For The Descent
import java.util.; import java.io.; import java.math.*;
/** * The while loop represents the game. * Each iteration represents a turn of the game * where you are given inputs (the heights of the mountains) * and where you have to print an output (the index of the mountain to fire on) * The inputs you are given are automatically updated according to your last actions. **/ class Player {
public static void main(String args[]) { Scanner in = new Scanner(System.in);
int[] mountainHeightArray = new int[8]; int heighestIndex = 0; int temp = 0; // game loop while (true) { for (int i = 0; i < 8; i++) { int mountainH = in.nextInt(); // represents the height of one mountain. mountainHeightArray[i] = mountainH; }
for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { if (mountainHeightArray[i] > mountainHeightArray[j]) { if (mountainHeightArray[i] > mountainHeightArray[temp]) { temp = i; } } else if (mountainHeightArray[i] < mountainHeightArray[j]) { if (mountainHeightArray[j] > mountainHeightArray[temp]) { temp = j; } } } }
// Write an action using System.out.println() // To debug: System.err.println(“Debug messages...”);
System.out.println(temp); // The index of the mountain to fire on. } } }
H2 Database in Spring Boot
Avoiding Null Checks in Java
SAML Technical Overview Committee Draft 02
http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html
XML Payload and Response in Spring Boot
https://www.bezkoder.com/spring-boot-rest-xml/ https://www.appsdeveloperblog.com/consuming-xml-in-spring-boot-rest/
Factory, Factory Method, & Abstract Factory in Java
https://www.baeldung.com/cs/factory-method-vs-factory-vs-abstract-factory
Enum in Java
Singleton in Java