diff --git a/Hackerrank/First.java b/Hackerrank/First.java new file mode 100644 index 0000000..3c9118b --- /dev/null +++ b/Hackerrank/First.java @@ -0,0 +1,28 @@ + import java.io.*; +import java.util.*; +import java.text.*; +import java.math.*; +import java.util.regex.*; + +public class Solution { +//This is a practice problem from hackerrank solve me first + + + static int solveMeFirst(int a, int b) { + // Hint: Type return a+b; below + + } + + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + int a; + a = in.nextInt(); + int b; + b = in.nextInt(); + int sum; + sum = solveMeFirst(a, b); + System.out.println(sum); + } +} + + diff --git a/Hackerrank/Hashmap.java b/Hackerrank/Hashmap.java new file mode 100644 index 0000000..4b81693 --- /dev/null +++ b/Hackerrank/Hashmap.java @@ -0,0 +1,30 @@ + +//Complete this code or write your own from scratch +import java.util.*; +import java.io.*; + +class Hashmap{ + public static void main(String []argh) + { + Scanner x = new Scanner(System.in); + int n=x.nextInt(); + x.nextLine(); + Map map = new HashMap(); + for(int i=0;i oddIndexes = new ArrayList<>(100); + for(int j= 0; j < word.length();j++){ + if(j % 2 == 0){ + System.out.print(word.charAt(j)); + }else{ + oddIndexes.add(j); + } + } + System.out.print(" "); + for(Integer index : oddIndexes){ + System.out.print(word.charAt(index)); + } + System.out.println(); + } + }} +