Skip to content

CypherKingdom/Hackerrank

Repository files navigation

HackerRank Solutions

This repository contains my solutions to various HackerRank coding challenges implemented in C++ and C#.

Problems Solved

C++ Solutions

  • Array Challenges
    • Birthday Cake Candles - Count how many candles are tallest
    • Diagonal Difference - Calculate the absolute difference between the sums of diagonals in a square matrix
    • Hour Glass - Find the maximum sum of hourglass patterns in a 2D array
    • Left Rotation - Rotate array elements to the left by a given number
    • Min-Max Sum - Find the minimum and maximum sums of 4 out of 5 integers
    • Staircase - Print a staircase pattern of '#' symbols

C# Solutions

Compilation and Execution

C++ Solutions

Each C++ solution can be compiled using g++ and executed separately:

g++ -o <filename_without_extension> <filename>.cpp
./<filename_without_extension>

For example:

g++ -o staircase staircase.cpp
./staircase

Alternatively, you can use the VS Code task configured in this repository to build the active file:

  1. Open the C++ file you want to compile
  2. Press Ctrl+Shift+B to run the build task
  3. Run the generated executable from the terminal

C# Solutions

The C# solutions can be compiled and run using the .NET SDK:

dotnet run <filename>.cs

To run a specific C# file, you might need to create a temporary project:

mkdir temp-project
cd temp-project
dotnet new console
# Replace Program.cs with your solution code or copy the relevant part
dotnet run

Repository Structure

├── .vscode/            # VS Code configuration files
├── *.cpp               # C++ solution files
├── *.cs                # C# solution files
└── README.md           # This documentation file

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors