Skip to content
the poor coder

Home / Author

Poor Man

2,994 posts
2020

Hackerrank Rectangle Area Solution

Create two classes: Rectangle The Rectangle class should have two data fields-width and height of int types. The class should have display() method, to print the width and height of the rectangle separated by space…

2020

Hackerrank Print Pretty Solution

Your manager gave you a text file with many lines of numbers to format and print. For each row of space-separated doubles, format and print the numbers using the specifications in the Output Format section below. Input…

2020

Hackerrank Maps-STL Solution

Maps are a part of the C++ STL.Maps are associative containers that store elements formed by a combination of a key value and a mapped value, following a specific order.The mainly used member functions of maps are: Map…

2020

Hackerrank Sets-STL Solution

Sets are a part of the C++ STL. Sets are containers that store unique elements following a specific order. Here are some of the frequently used member functions of sets: Declaration: Size: Insert: Erasing an element…

2020

Hackerrank Lower Bound-STL Solution

You are given integers in sorted order. Also, you are given queries. In each query, you will be given an integer and you have to tell whether that integer is present in the array. If so, you have to tell at which index…

2020

Hackerrank Vector-Erase Solution

You are provided with a vector of integers. Then, you are given queries. For the first query, you are provided with integer, which denotes a position in the vector. The value at this position in the vector needs to be…

2020

Hackerrank Vector-Sort Solution

You are given integers.Sort the integers and print the sorted order. Store the integers in a vector.Vectors are sequence containers representing arrays that can change in size. Declaration: Size: Pushing an integer into…

2020

Hackerrank Box It! Solution

Design a class named Box whose dimensions are integers and private to the class. The dimensions are labelled: length , breadth , and height . The default constructor of the class should initialize , , and to . The…

2020

Hackerrank Classes and Objects Solution

A class defines a blueprint for an object. We use the same syntax to declare objects of a class as we use to declare variables of other basic types. For example: Kristen is a contender for valedictorian of her high…

2020

Hackerrank Class Solution

Classes in C++ are user defined types declared with keyword class that has data and functions . Although classes and structures have the same type of functionality, there are some basic differences. The data members of…

2020

Hackerrank Structs Solution

struct is a way to combine multiple fields to represent a composite data structure, which further lays the foundation for Object Oriented Programming. For example, we can store details related to a student in a struct…

2020

Hackerrank Strings Solution

C++ provides a nice alternative data type to manipulate strings, and the data type is conveniently called string. Some of its widely used features are the following: Declaration: Size: Concatenate two strings: Accessing…

2020

Hackerrank StringStream Solution

stringstream is a stream class to operate on strings. It basically implements input/output operations on memory (string) based streams. stringstream can be helpful in different type of parsing. The following…

2020

Hackerrank Pointer Solution

A pointer in C is a way to share a memory address among different contexts (primarily functions). They are primarily used whenever a function needs to modify the content of a variable, of which it doesn't have…

ESC