From e3218ce6189a310ece69b0c846efb153eb97f3bc Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 4 Oct 2019 21:23:29 +0530 Subject: [PATCH 1/3] Add hackerrank problem on Hashmap to Contributors list --- Hackerrank/Hashmap.java | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Hackerrank/Hashmap.java 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 Date: Fri, 4 Oct 2019 21:28:42 +0530 Subject: [PATCH 2/3] Add hackerrank problem on print odd and even characters to Contributors list --- Hackerrank/Review.java | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Hackerrank/Review.java diff --git a/Hackerrank/Review.java b/Hackerrank/Review.java new file mode 100644 index 0000000..32127eb --- /dev/null +++ b/Hackerrank/Review.java @@ -0,0 +1,35 @@ + import java.io.*; +import java.util.*; +import java.text.*; +import java.math.*; +import java.util.regex.*; +import java.lang.Iterable.*; + +public class Review { +//code to print odd and even numbers separetely + public static void main(String[] args) { + /*Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ + Scanner x=new Scanner(System.in); + int n=x.nextInt(); + x.nextLine(); + String strings[]=new String[100] ; + 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(); + } + }} + From c4be1965d93e90a596b5c8d88a2f5a7ac04d00c4 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 4 Oct 2019 21:41:20 +0530 Subject: [PATCH 3/3] Add Solve me first to Contributions --- Hackerrank/First.java | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Hackerrank/First.java 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); + } +} + +