HackerRank Java

Java Exception Handling – Hacker Rank Solution

Objective You are required to compute the power of a number by implementing a calculator. Create a class MyCalculator which consists of a single method long power(int, int). This method takes two integers, n and p, as parameters and finds .  Problem Statement: Click Here Java Exception Handling – Hacker Rank Solution Disclaimer: The above Problem (Java Exception Handling ) is generated by Hackerrank but the …

Java Exception Handling – Hacker Rank Solution Read More »

Valid Username Regular Expression – Hacker Rank Solution

Objective You are updating the username policy on your company’s internal networking platform. According to the policy, a username is considered valid if all the following constraints are satisfied: The username consists of  to  characters inclusive. If the username consists of less than 8 or greater than 30 characters, then it is an invalid username. Problem Statement: Click Here Valid Username …

Valid Username Regular Expression – Hacker Rank Solution Read More »

Java SHA 256 – Hacker Rank Solution

Objective Cryptographic hash functions are mathematical operations run on digital data; by comparing the computed hash (i.e., the output produced by executing a hashing algorithm) to a known and expected hash value, a person can determine the data’s integrity. For example, computing the hash of a downloaded file and comparing the result to a previously published hash …

Java SHA 256 – Hacker Rank Solution Read More »

Java Lambda Expressions – Hacker Rank Solution

Objective This Java 8 challenge tests your knowledge of Lambda expressions! Write the following methods that return a lambda expression performing a specified action: PerformOperation isOdd(): The lambda expression must return True  if a number is odd or False if it is even. PerformOperation isPrime(): The lambda expression must return True   if a number is prime or False  if it is composite. PerformOperation isPalindrome(): The …

Java Lambda Expressions – Hacker Rank Solution Read More »