Skip to content

SL TECH ACADEMY

Contact us
  • Home
  • C++
  • Pyhton
  • Java
  • Networking
  • Problem Solving
    • Algorithms
    • Data Structures
  • Contests
    • IOI
    • APIO
    • Google
      • Code Jam
      • Hash Code
      • Kick Start
  • Resources

SL TECH ACADEMY

Tag: HackerRank c++

  • C++

Print Pretty – HackerRank Solution

imageByPasindu PiumalAugust 18, 2020
Print Pretty – HackerRank Solution
Problem : Your manager gave you a text file with many lines of numbers to format and print. For each row of 3 space-separated doubles, format and print the numbers using the specifications in the Output Format section below. Input Format : The first line

Read More

  • C++

Maps-STL – HackerRank Solution

imageByPasindu PiumalAugust 14, 2020
Maps-STL – HackerRank Solution
Problem : 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 Template : Declaration : Size : Insert :

Read More

  • C++

Sets-STL – HackerRank Solution

imageByPasindu PiumalAugust 14, 2020
Sets-STL – HackerRank Solution
Problem : 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 : Finding an element : To know more about

Read More

  • C++

Lower Bound-STL – HackerRank

imageByPasindu PiumalAugust 14, 2020
Lower Bound-STL – HackerRank
You are given N integers in sorted order. Also, you are given Q 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 it is present and if it is not

Read More

  • C++

Vector-Erase – HackerRank Solution

imageByPasindu PiumalAugust 14, 2020
Vector-Erase – HackerRank Solution
You are provided with a vector of N integers. Then, you are given 2 queries. For the first query, you are provided with 1 integer, which denotes a position in the vector. The value at this position in the vector needs to be erased. The next

Read More

  • C++

Vector-Sort – HackerRank Solution

imageByPasindu PiumalAugust 14, 2020
Vector-Sort – HackerRank Solution
Problem : You are given N integers.Sort the N integers and print the sorted order.Store the N integers in a vector.Vectors are sequence containers representing arrays that can change in size. Declaration : Size : Pushing an integer into a vector

Read More

  • C++

Virtual Functions – HackerRank Solution

imageByPasindu PiumalAugust 14, 2020
Virtual Functions – HackerRank Solution
This problem is to get you familiar with virtual functions. Create three classes Person, Professor and Student. The class Person should have data members name and age. The classes Professor and Student should inherit from the

Read More

  • C++

Classes and Objects – HackerRank Solution

imageByPasindu PiumalAugust 11, 2020
Classes and Objects – HackerRank Solution
Problem : 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 school. She wants to know how many

Read More

  • C++

Class – HackerRank Solution

imageByPasindu PiumalAugust 11, 2020
Class – HackerRank Solution
Problem : 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 a class are private by default and the members

Read More

  • C++

Structs – HackerRank Solution

imageByPasindu PiumalAugust 11, 2020
Structs – HackerRank Solution
Problem : 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 consisting of his age (int),

Read More

  • C++

Strings – HackerRank Solution

imageByPasindu PiumalAugust 7, 2020
Strings – HackerRank Solution
Problem : 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 i^th element :

Read More

  • C++

StringStream – HackerRank Solution

imageByPasindu PiumalAugust 7, 2020
StringStream – HackerRank Solution
Problem : 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 operators/functions are commonly used here

Read More

  • C++

Attribute Parser – HackerRank Solution

imageByPasindu PiumalAugust 7, 2020
Attribute Parser – HackerRank Solution
Problem : We have defined our own markup language HRML. In HRML, each element consists of a starting and ending tag, and there are attributes associated with each tag. Only starting tags can have attributes. We can call an attribute by referencing the tag, followed by a

Read More

  • C++

Variable Sized Arrays – HackerRank Solution

imageByPasindu PiumalAugust 6, 2020
Variable Sized Arrays – HackerRank Solution
Problem : Consider an n-element array, a, where each index i in the array contains a reference to an array of ki integers (where the value of ki varies from array to array). See the Explanation section below for a diagram.

Read More

  • C++

Arrays Introduction – HackerRank Solution

imageByPasindu PiumalAugust 6, 2020
Arrays Introduction – HackerRank Solution
An array is a series of elements of the same type placed in contiguous memory locations that can be individually referenced by adding an index to a unique identifier. Declaration : Accessing elements of an array : You’ll be given an array of N integers and

Read More

  • Algorithms

Plus Minus – HackerRank Solution

imageByPasindu PiumalAugust 6, 2020
Plus Minus – HackerRank Solution
Problem : Given an array of integers, calculate the ratios of its elements that are positive, negative, and zero. Print the decimal value of each fraction on a new line with 6 places after the decimal. Note: This challenge introduces precision

Read More

  • Algorithms

Diagonal Difference – HackerRank Solution

imageByPasindu PiumalAugust 6, 2020
Diagonal Difference – HackerRank Solution
Problem : Given a square matrix, calculate the absolute difference between the sums of its diagonals. For example, the square matrix arr is shown below: The left-to-right diagonal = 1 + 5 + 9 = 15. The right to left diagonal = 3 + 5 + 9 = 15. Their

Read More

  • Algorithms

A Very Big Sum -HackerRank Solution

imageByPasindu PiumalAugust 6, 2020
A Very Big Sum -HackerRank Solution
Problem : In this challenge, you are required to calculate and print the sum of the elements in an array, keeping in mind that some of those integers may be quite large. Function Description : Complete the aVeryBigSum function in the editor below. It must return

Read More

  • C++

Pointer – HackerRank Solution

imageByPasindu PiumalJuly 21, 2020
Pointer – HackerRank Solution
Problem : 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 ownership. In order to access the

Read More

  • C++

Functions – HackerRank Solution

imageByPasindu PiumalJuly 21, 2020
Functions – HackerRank Solution
Problem : Functions are a bunch of statements glued together. A function is provided with zero or more arguments, and it executes the statements on it. Based on the return type, it either returns nothing (void) or something. A sample syntax for a function is For example, a

Read More

Posts navigation

Page 1 Page 2 NextNext page

Last Posts

IOI 2020

IOI 2020 – Contest Day 1- Tickets Problem and Solution

September 24, 2020
IOI 2020

IOI 2020 – Contest Day 1- Supertrees Problem and Solution

September 24, 2020
IOI 2020

IOI 2020 – Contest Day 1- Plants Problem and Solution

September 24, 2020

Day of the Programmer – HackerRank Solution

September 11, 2020

APIO 2020 Problems and Solutions – Fun Tour

September 5, 2020

Archives

  • September 2020 (10)
  • August 2020 (68)
  • July 2020 (18)
Created by SL TECH ACADEMY. Powered by WordPress
Logo
  • Home
  • C++
  • Pyhton
  • Java
  • Networking
  • Problem Solving
    • Algorithms
    • Data Structures
  • Contests
    • IOI
    • APIO
    • Google
      • Code Jam
      • Hash Code
      • Kick Start
  • Resources