How to reverse a string without disturbing the order in java: https://persmin.org/how-to-reverse-a-string-without-disturbing-the-order-in-java/
U K import java.math.BigInteger; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); for (int i = 0; i < t; i++) { int n = sc.nextInt(); int sum = 0; String square = BigInteger.TWO.pow(n).toString(); for (int j = 0; j < square.length(); j++) { sum += square.charAt(j) - 48; } while (sum >= 10) { n = sum; sum = 0; for (; n > 0; n /= 10) { sum += n % 10; } } System.out.println(sum); } } }
K import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int billAmount = sc.nextInt(); sc.close(); int even = 0, odd = 0; for (; billAmount != 0; billAmount /= 10) { int digit = billAmount % 10; if ((digit & 1) == 0) { even += digit; } else { odd += digit; } } System.out.println(Math.abs(even - odd)); } }
GgPhoto
The WebDriver class is not found in the classpath. Include its jar in the build path
Download it from https://www.selenium.dev/downloads/ or include its dependency if you are using a build tool - org.seleniumhq.selenium:selenium-java:4.1.2