You've successfully subscribed to The Poor Coder | Hackerrank Solutions
Great! Next, complete checkout for full access to The Poor Coder | Hackerrank Solutions
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.

Data Structures

Beeze Aal

Hackerrank Java BitSet Solution

Java's BitSet class implements a vector of bit values (i.e.:  () or  ()) that grows as needed, allowing us to easily manipulate bits while optimizing space (when compared to other collections). Any element having a bit value of  is called a set bit. Given  BitSets,  and , of size  where all bits
Beeze Aal

Hackerrank Java Sort Solution

You are given a list of student information: ID, FirstName, and CGPA. Your task is to rearrange them according to their CGPA in decreasing order. If two student have the same CGPA, then arrange them according to their first name in alphabetical order. If those two students also have the
Beeze Aal

Hackerrank Java Hashset Solution

In computer science, a set is an abstract data type that can store certain values, without any particular order, and no repeated values(Wikipedia).  is an example of a set, but  is not a set. Today you will learn how to use sets in java by solving this problem. You
Beeze Aal

Hackerrank Java List Solution

For this problem, we have  types of queries you can perform on a List: Insert  at index : Insert x y Delete the element at index : Delete x Given a list, , of  integers, perform  queries on the list. Once all queries are completed, print the modified list as a single line
Beeze Aal

Hackerrank Java Arraylist Solution

.MathJax_SVG_LineBox {display: table!important} .MathJax_SVG_LineBox span {display: table-cell!important; width: 10000em!important; min-width: 0; max-width: none; padding: 0; border: 0; margin: 0} Sometimes it's better to use dynamic size arrays. Java's  Arraylist can provide you this feature. Try to solve this problem using Arraylist. You are
Beeze Aal

Hackerrank Java Subarray Solution

We define the following: A subarray of an -element array is an array composed from a contiguous block of the original array's elements. For example, if , then the subarrays are , , , , , and . Something like  would not be a subarray as it's not a contiguous subsection of the original array.The sum
Beeze Aal

Hackerrank Java 2D Array Solution

You are given a  2D array. An hourglass in an array is a portion shaped like this: a b c d e f g For example, if we create an hourglass using the number 1 within an array full of zeros, it may look like this: 1 1 1 0
Beeze Aal

Hackerrank Java 1D Array Solution

An array is a simple data structure used to store a collection of data in a contiguous block of memory. Each element in the collection is accessed using an index, and the elements are easy to find because they're stored sequentially in memory. Because the collection of elements in an
Beeze Aal

Hackerrank Java Priority Queue Solution

In computer science, a priority queue is an abstract data type which is like a regular queue, but where additionally each element has a "priority" associated with it. In a priority queue, an element with high priority is served before an element with low priority. - Wikipedia In this problem
Beeze Aal

Hackerrank Java Dequeue Solution

In computer science, a double-ended queue (dequeue, often abbreviated to deque, pronounced deck) is an abstract data type that generalizes a queue, for which elements can be added  to or removed from either the front (head) or back (tail). Deque interfaces can be implemented using various types of collections such
Beeze Aal

Hackerrank Java Comparator Solution

Comparators are used to compare two objects. In this challenge, you'll create a comparator and use it to sort an array. The Player class is provided for you in your editor. It has  fields: a  String and a  integer. Given an array of  Player objects, write a comparator that sorts
Beeze Aal

Hackerrank Java Stack Solution

In computer science, a stack or LIFO (last in, first out) is an abstract data type that serves as a collection of elements, with two principal operations: push, which adds an element to the collection, and pop, which removes the last element that was added.(Wikipedia) A string containing only