Hackerrank – Java Solution – Java Strings Introduction Solution

Hackerrank – Java Solution – Java Strings Introduction Solution Problem Name – Java Strings IntroductionProblem Link –  Java Strings Introduction  Level – String Java Code import java.util.Scanner;public class Solution { public static void main(String[] args) { /* Save input */ Scanner scan = new Scanner(System.in); String A = scan.next(); String B = scan.next(); scan.close(); /* Sum […]

Continue Reading

Hackerrank – Java Solution – Java Currency Formatter Solution

Hackerrank – Java Solution – Java Currency Formatter Solution Problem Name – Java Currency FormatterProblem Link –  Java Currency Formatter  Level – Introduction Challenges Java Code import java.util.Scanner;import java.text.NumberFormat;import java.util.Locale;public class Solution { public static void main(String[] args) { /* Save input */ Scanner scan = new Scanner(System.in); double payment = scan.nextDouble(); scan.close(); /* Create custom […]

Continue Reading

Hackerrank – Java Solution – Java Int to String Solution

Hackerrank – Java Solution – Java Int to String Solution Problem Name – Java Int to StringProblem Link –  Java Int to StringLevel – Introduction Challenges Java Only Submit Part Code  String s = “” + n; Java Full Source Code  import java.util.*;import java.security.*;public class Solution { public static void main(String[] args) { DoNotTerminate.forbidExit(); try { […]

Continue Reading

Hackerrank – Java Solution – Java Static Initializer Block Solution

Hackerrank – Java Solution – Java Static Initializer Block Solution Problem Name – Java Static Initializer Block SolutionProblem Link –  Java Static Initializer BlockLevel – Introduction Challenges Java Static Initializer Full Code import java.io.*;import java.util.*;import java.text.*;import java.math.*;import java.util.regex.*;public class Solution { private static int B; private static int H; private static boolean flag; static { Scanner […]

Continue Reading

Hackerrank – Java Solution – Java End-of-file Solution

Hackerrank – Java Solution – Java End-of-file Solution Problem Name –  Java End-of-fileProblem Link –  Java End Of FileLevel – Introduction ChallengesOnline Judge – HackerRank Java Code import java.util.Scanner;public class Solution { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int i = 1; while (scan.hasNextLine()) { System.out.println(i + ” ” + scan.nextLine()); […]

Continue Reading

Hackerrank – Java Solution – Java Datatypes

Hackerrank – Java Solution – Java Datatypes Problem Name – Java DatatypesProblem Link –  Java DatatypesLevel – Introduction Challenges Java Code import java.util.Scanner;class Solution { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int t = scan.nextInt(); for (int i = 0; i < t; i++) { try { long x = scan.nextLong(); […]

Continue Reading

Hackerrank – Java Solution – Java Loops II

Hackerrank – Java Solution – Java Loops II Problem Name – Java Loops IIProblem Link –  https://www.hackerrank.com/challenges/java-loops Level – Introduction Challenges Java Code import java.util.Scanner;class Solution{ public static void main(String[] args) { Scanner scan = new Scanner(System.in); int t = scan.nextInt(); for (int i = 0; i < t; i++) { int a = scan.nextInt(); int […]

Continue Reading

Hackerrank – Java Solution – Java Loops I

Hackerrank – Java Solution – Java Loops I Problem Name – Java Loops IProblem Link –  https://www.hackerrank.com/challenges/java-loops-i/problem Level – Introduction ChallengesOnline Judge – Hacker Rank Java Code import java.util.Scanner;public class Solution { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int multiplier = scan.nextInt(); scan.close(); for (int i = 1; i <= 10; […]

Continue Reading

Hackerrank – Java Solution – Java Output Formatting

Hackerrank – Java Solution – Java Output Formatting Problem Name – Java Output FormattingProblem Link –  https://www.hackerrank.com/challenges/java-output-formatting/problem Level – Introduction ChallengesOnline Judge – HackerRank Java Code import java.util.Scanner;public class Solution { public static void main(String[] args) { Scanner scan = new Scanner(System.in); System.out.println(“================================”); for (int i = 0; i < 3; i++) { String s1 = […]

Continue Reading

Hackerrank – Java Solution – Java Stdin and Stdout II

Hackerrank – Java Solution – Java Stdin and Stdout II Problem Name – Java Stdin and Stdout IIProblem Link –  https://www.hackerrank.com/challenges/java-stdin-stdout/problem Level – Introduction Challenges Java Code import java.util.Scanner;public class Solution { public static void main(String[] args) { /* Read input */ Scanner scan = new Scanner(System.in); int i = scan.nextInt(); double d = scan.nextDouble(); scan.nextLine(); […]

Continue Reading