Added 28 solutions

This commit is contained in:
rshaghoulian
2017-03-10 01:10:37 -06:00
parent 3a6797a94a
commit b1992b3e60
37 changed files with 1187 additions and 309 deletions
+26
View File
@@ -0,0 +1,26 @@
// Author: Rodney Shaghoulian
// Github: github.com/rshaghoulian
// HackerRank: hackerrank.com/rshaghoulian
import java.util.Scanner;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class Solution {
public static void main(String[] args) throws NoSuchAlgorithmException {
/* Read and save the input String */
Scanner scan = new Scanner(System.in);
String str = scan.next();
scan.close();
/* Encode the String using MD5 */
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(str.getBytes());
byte[] digest = md.digest();
/* Print the encoded value in hexadecimal */
for (byte b : digest) {
System.out.format("%02x", b);
}
}
}