Skip to content
the poor coder

Home / Topics / #hackerrank

#Hackerrank

419 posts · page 8 of 21
2020

Hackerrank Java String Tokens Solution

Given a string, , matching the regular expression [A-Za-z !,?._'@]+, split the string into tokens. We define a token to be one or more consecutive English alphabetic letters. Then, print the number of tokens, followed…

2020

Hackerrank Java Anagrams Solution

Two strings, and , are called anagrams if they contain all the same characters in the same frequencies. For example, the anagrams of CAT are CAT, ACT, TAC, TCA, ATC, and CTA. Complete the function in the editor. If and…

2020

Hackerrank Java Datatypes Solution

Java has 8 primitive data types; char, boolean, byte, short, int, long, float, and double. For this exercise, we'll work with the primitives used to hold integer values (byte, short, int, and long): A byte is an 8-bit…

2020

Hackerrank Java Loops II Solution

We use the integers , , and to create the following series: You are given queries in the form of , , and . For each query, print the series corresponding to the given , , and values as a single line of space-separated…

2020

Hackerrank Java Loops I Solution

Objective In this challenge, we're going to use loops to help us do some simple math. Task Given an integer, , print its first multiples. Each multiple (where ) should be printed on a new line in the form: N x i =…

2020

Hackerrank Java If-Else Solution

In this challenge, we test your knowledge of using if-else conditional statements to automate decision-making processes. An if-else statement has the following logical flow: Source: Wikipedia Task Given an integer…

2020

Hackerrank Java Annotations Solution

Java annotation can be used to define the metadata of a Java class or class element. We can use Java annotation at the compile time to instruct the compiler about the build process. Annotation is also used at runtime to…

2020

Hackerrank Can You Access? Solution

You are given a class Solution and an inner class Inner.Private. The main method of class Solution takes an integer as input. The powerof2 in class Inner.Private checks whether a number is a power of . You have to call…

2020

Hackerrank Java Stack Solution

A string containing only parentheses is balanced if the following is true: 1. if it is an empty string 2. if A and B are correct, AB is correct, 3. if A is correct, (A) and {A} and [A] are also correct. Examples of some…

ESC