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(); + } + }} +