Skip to content

Solutions to some of the problems on Hacker rank. Been a while since I've done questions on Hackerrank and some are not updated here. I'm busy with other things and hope to add more solutions in the future.

Notifications You must be signed in to change notification settings

chandraprakash-dev/HackerRank

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

HackerRank

My hackerrank profile Solutions to some problems on Hackerrank.

LANGUAGE PROFICIENCY

C

Subdomain Difficulty Challenge Solution
Introduction Easy "Hello World!" in C HelloWorld.c
Introduction Easy Playing With Characters PlayingWithCharacters.c
Introduction Easy Sum and Difference of Two Numbers SumAndDifferenceOfTwoNumbers.c
Introduction Easy Functions in C FunctionsInC.c
Introduction Easy Pointers in C PointersInC.c
Conditionals and Loops Easy Conditional Statements in C ConditionalStatementsInC.c
Conditionals and Loops Easy For Loop in C ForLoopInC.c
Conditionals and Loops Easy Sum of Digits of a Five Digit Number SumOfDigitsOfAFiveDigitNumber.c
Conditionals and Loops Easy Bitwise Operators BitwiseOperators.c
Conditionals and Loops Medium Printing Pattern using Loops PrintingPatternsUsingLoops.c
Arrays and Strings Medium 1D Arrays in C 1DArraysInC.c
Arrays and Strings Medium Array Reversal ArrayReversal.c
Arrays and Strings Medium Digit Frequency DigitFrequency.c
Arrays and Strings Medium Printing Tokens PrintingTokens.c
Arrays and Strings Medium Dynamic Array in C DynamicArrayInC.c
Functions Easy Calculate the Nth term CalculateTheNthTerm.c
Functions Easy Students Marks Sum StudentsMarksSum.c
Functions Hard Sorting Array of Strings SortingArrayOfStrings.py
Functions Medium Permutations of Strings PermutationsOfStrings.c
Functions Medium Variadic functions in C VariadicFunctionsInC.c
Functions Hard Querying the Document QueryingTheDocument.c
Structs and Enums Easy Boxes through a Tunnel BoxesThroughATunnel.c
Structs and Enums Medium Small Triangles, Large Triangles SmallTrianglesLargeTriangles.cpp
Structs and Enums Hard Post Transition PostTransition.c
Structs and Enums Hard Structuring the Document StructuringTheDocument.c

C++

Subdomain Difficulty Challenge Solution
Introduction Easy Say "Hello, World!" With C++ SayHelloWorldWithCPlusPlus.cpp
Introduction Easy Input and Output InputAndOutput.cpp
Introduction Easy Basic Data Types BasicDataTypes.cpp
Introduction Easy Conditional Statements ConditionalStatements.cpp
Introduction Easy For Loop ForLoop.cpp
Introduction Easy Functions Functions.cpp
Introduction Easy Pointer Pointer.cpp
Introduction Easy Arrays Introduction ArraysIntroduction.cpp
Introduction Easy Variable Sized Arrays VariableSizedArrays.cpp
Strings Easy Strings Strings.cpp
Strings Easy StringStream StringStream.cpp
Strings Medium Attribute Parser AttributeParser.cpp
Classes Easy Structs Structs.cpp
Classes Easy Class Class.cpp
Classes Easy Classes and Objects ClassesAndObjects.cpp
Classes Easy Box It! BoxIt.cpp
Classes Medium Inherited Code InheritedCode.cpp
Classes Medium Exceptional Server ExceptionalServer.cpp
Classes Medium Virtual Functions VirtualFunctions.cpp
Classes Hard Abstract Classes - Polymorphism AbstractClassesPolymorphism.cpp
Inheritance Easy Inheritance Introduction InheritanceIntroduction.cpp
Inheritance Easy Rectangle Area RectangleArea.cpp
Inheritance Easy Multi Level Inheritance MultiLevelInheritance.cpp
Inheritance Medium Accessing Inherited Functions AccessingInheritedFunctions.cpp
Inheritance Hard Magic Spells MagicSpells.cpp
STL Easy Vector-Sort VectorSort.cpp
STL Easy Vector-Erase VectorErase.cpp
STL Easy Lower Bound-STL LowerBoundStl.cpp
STL Easy Sets-STL SetsStl.cpp
STL Easy Maps-STL MapsStl.cpp
STL Easy Print Pretty PrintPretty.cpp
STL Medium Deque-STL DequeStl.cpp
Other Concepts Easy C++ Class Templates ClassTemplates.cpp
Other Concepts Easy Preprocessor Solution PreprocessorSolution.cpp
Other Concepts Medium Operator Overloading OperatorOverloading.cpp
Other Concepts Easy Overload Operators OverloadOperators.cpp
Other Concepts Medium Attending Workshops AttendingWorkshops.cpp
Other Concepts Medium C++ Class Template Specialization ClassTemplateSpecialization.cpp

Java

Subdomain Difficulty Challenge Solution
Introduction Easy Welcome to Java! WelcomeToJava.java
Introduction Easy Java Stdin and Stdout I JavaStdInAndStdOut1.java
Introduction Easy Java If-Else JavaIfElse.java
Introduction Easy Java Output Formatting JavaOutputFormatting.java
Introduction Easy Java Loops I JavaLoops1.java
Introduction Easy Java Loops II JavaLoops2.java
Introduction Easy Java Datatypes JavaDatatypes.java
Introduction Easy Java End-of-file JavaEndOfFile.java
Introduction Easy Java Static Initializer Block JavaStaticInitializerBlock.java
Introduction Easy Java Int to String JavaIntToString.java
Introduction Easy Java Date and Time JavaDateAndTime.java
Introduction Easy Java Currency Formatter JavaCurrencyFormatter.java
Strings Easy Java Strings Introduction JavaStringsIntroduction.java
Strings Easy Java Substring JavaSubstring.java
Strings Easy Java Substring Comparisons JavaSubstringComparisons.java
Strings Easy Java String Reverse JavaStringReverse.java
Strings Easy Java Anagrams JavaAnagrams.java
Strings Easy Java String Tokens JavaStringTokens.java
Strings Easy Pattern Syntax Checker PatternSyntaxChecker.java
Strings Medium Java Regex JavaRegex.java
Strings Medium Java Regex 2 - Duplicate Words JavaRegex2DuplicateWords.java
Strings Easy Valid Username Regular Expression ValidUsernameRegularExpression.java
Strings Medium Tag Content Extractor TagContentExtractor.java
BigNumber Medium Java BigDecimal JavaBigDecimal.java
BigNumber Easy Java BigInteger JavaBigInteger.java
BigNumber Easy Java Primality Test JavaPrimalityTest.java
Data Structures Easy Java 1D Array Java1DArray.java
Data Structures Easy Java 2D Array Java2DArray.java
Data Structures Easy Java List JavaList.java
Data Structures Easy Java Subarray JavaSubarray.java
Data Structures Easy Java Arraylist JavaArraylist.java

Python

Subdomain Difficulty Challenge Solution
Introduction Easy Say "Hello, World!" With Python SayHelloWorldWithPython.py
Introduction Easy Python If-Else PythonIfElse.py
Introduction Easy Arithmetic Operators ArithmeticOperators.py
Introduction Easy Python: Division PythonDivision.py
Introduction Easy Loops Loops.py
Introduction Easy Print Function PrintFunction.py
Introduction Medium Write a function WriteAFunction.py
Basic Data Types Easy Lists Lists.py
Basic Data Types Easy Tuples Tuples.py
Basic Data Types Easy List Comprehensions ListComprehensions.py
Basic Data Types Easy Find the Runner-Up Score! FindTheRunnerUpScore.py
Basic Data Types Easy Nested Lists NestedLists.py
Basic Data Types Easy Finding the percentage FindingThePercentage.py
Strings Easy sWAP cASE SwapCase.py
Strings Easy String Split and Join StringSplitAndJoin.py
Strings Easy What's Your Name? WhatsYourName.py
Strings Easy Mutations Mutations.py
Strings Easy Find a string FindAString.py
Strings Easy String Validators StringValidators.py
Strings Easy Text Alignment TextAlignment.py
Strings Easy Text Wrap TextWrap.py
Strings Easy Designer Door Mat DesignerDoorMat.py
Strings Easy String Formatting StringFormatting.py
Strings Easy Alphabet Rangoli AlphabetRangoli.py
Strings Easy Capitalize! Capitalize.py
Strings Medium The Minion Game TheMinionGame.py
Strings Medium Merge the Tools! MergeTheTools.py
Sets Easy Introduction to Sets IntroductionToSets.py
Sets Medium No Idea! NoIdea.py
Sets Easy Symmetric Difference SymmetricDifference.py
Sets Easy Set .add() SetAdd.py
Sets Easy Set .discard(), .remove() & .pop() SetDiscardRemovePop.py
Sets Easy Set .union() Operation SetUnion.py
Sets Easy Set .intersection() Operation SetIntersection.py
Sets Easy Set .difference() Operation SetDifference.py
Sets Easy Set .symmetric_difference() Operation SetSymmetricDifference.py
Sets Easy Set Mutations SetMutations.py
Sets Easy The Captain's Room TheCaptiansRoom.py
Sets Easy Check Subset CheckSubset.py
Sets Easy Check Strict Superset CheckStrictSuperset.py
Math Easy Polar Coordinates PolarCoordinates.py
Math Medium Find Angle MBC FindAngleMBC.py
Math Easy Mod Divmod ModDivmod.py
Math Easy Power - Mod Power PowerModPower.py
Math Easy Integers Come In All Sizes IntegersComeInAllSizes.py
Math Medium Triangle Quest TriangleQuest.py
Math Medium Triangle Quest 2 TriangleQuest2.py
Itertools Easy itertools.product() itertools_product.py
Itertools Easy itertools.permutations() itertools_permutations.py
Itertools Easy itertools.combinations() itertools_combinations.py
Itertools Easy itertools.combinations() with replacement itertools_combinations_with_replacement.py
Itertools Medium compress the string compress_the_string.py
Itertools Medium iterables and iterators iterables_and_iterators.py
itertools Hard maximize it maximize_it.py

Shell

Subdomain Difficulty Challenge Solution
Bash Easy Let's Echo LetsEcho.sh
Bash Easy A Personalized Echo APersonalizedEcho.sh
Bash Easy Looping and Skipping LoopingAndSkipping.sh
Bash Easy Looping with Numbers LoopingWithNumbers.sh
Bash Easy The World of Numbers TheWorldOfNumbers.sh
Bash Easy Comparing Numbers ComparingNumbers.sh
Bash Easy Getting started with conditionals ComparingNumbers.sh
Bash Easy More on Conditionals MoreOnConditionals.sh
Bash Medium Arithmetic Operations ArithmeticOperations.sh
Bash Medium Compute the Average ComputeTheAverage.sh
Bash Hard Functions and Fractals - Recursive Trees - Bash! FunctionsAndFractalsRecursiveTreesBash.sh
Text Processing Easy Cut #1 Cut#1.sh
Text Processing Easy Cut #2 Cut#2.sh
Text Processing Easy Cut #3 Cut#3.sh
Text Processing Easy Cut #4 Cut#4.sh
Text Processing Easy Cut #5 Cut#5.sh
Text Processing Easy Cut #6 Cut#6.sh
Text Processing Easy Cut #7 Cut#7.sh
Text Processing Easy Cut #8 Cut#8.sh
Text Processing Easy Cut #9 Cut#9.sh
Text Processing Easy Head of a Text File #1 HeadOfATextFile#1.sh
Text Processing Easy Head of a Text File #2 HeadOfATextFile#2.sh
Text Processing Easy Tail of a Text File #1 TailOfATextFile#1.sh
Text Processing Easy Tail of a Text File #2 TailOfATextFile#2.sh
Text Processing Easy Middle of a Text File MiddleOfATextFile.sh
Text Processing Easy 'Tr' Command #1 TrCommand#1.sh
Text Processing Easy 'Tr' Command #2 TrCommand#2.sh
Text Processing Easy 'Tr' Command #3 TrCommand#3.sh
Text Processing Easy Sort Command #1 SortCommand#1.sh
Text Processing Easy Sort Command #2 SortCommand#2.sh
Text Processing Easy Sort Command #3 SortCommand#3.sh
Text Processing Easy Sort Command #4 SortCommand#4.sh
Text Processing Easy Sort Command #5 SortCommand#5.sh
Text Processing Easy Sort Command #6 SortCommand#6.sh
Text Processing Easy Sort Command #7 SortCommand#7.sh
Text Processing Easy 'Uniq' Command #1 UniqCommand#1.sh
Text Processing Easy 'Uniq' Command #2 UniqCommand#2.sh
Text Processing Easy 'Uniq' Command #3 UniqCommand#3.sh
Text Processing Easy 'Uniq' Command #4 UniqCommand#4.sh
Text Processing Medium Paste - 1 Paste1.sh
Text Processing Medium Paste - 2 Paste2.sh
Text Processing Medium Paste - 3 Paste3.sh
Text Processing Medium Paste - 4 Paste4.sh
Arrays in Bash Easy Read in an Array ReadInAnArray.sh
Arrays in Bash Easy Slice an Array SliceAnArray.sh
Arrays in Bash Medium Filter an Array with Patterns FilterAnArrayWithPatterns.sh
Arrays in Bash Easy Concatenate an array with itself ConcatenateAnArrayWithItself.sh
Arrays in Bash Easy Display an element of an array DisplayAnElementOfAnArray.sh
Arrays in Bash Easy Count the number of elements in an Array CountTheNumberOfElementsInAnArray.sh
Arrays in Bash Medium Remove the First Capital Letter from Each Element RemoveTheFirstCapitalLetterFromEachElement.sh
Arrays in Bash Hard Lonely Integer - Bash! LonelyIntegerBash.sh
Grep Sed Awk Easy 'Grep' - A GrepA.sh
Grep Sed Awk Easy 'Grep' - B GrepB.sh
Grep Sed Awk Medium 'Grep' #1 Grep#1.sh
Grep Sed Awk Medium 'Grep' #2 Grep#2.sh
Grep Sed Awk Medium 'Grep' #3 Grep#3.sh
Grep Sed Awk Medium 'Sed' command #1 SedCommand#1.sh
Grep Sed Awk Medium 'Sed' command #2 SedCommand#2.sh
Grep Sed Awk Easy 'Sed' command #3 SedCommand#3.sh
Grep Sed Awk Hard 'Sed' command #4 SedCommand#4.sh
Grep Sed Awk Hard 'Sed' command #5 SedCommand#5.sh
Grep Sed Awk Medium 'Awk' - 1 Awk1.sh
Grep Sed Awk Medium 'Awk' - 2 Awk2.sh
Grep Sed Awk Medium 'Awk' - 3 Awk3.sh
Grep Sed Awk Medium 'Awk' - 4 Awk4.sh

TUTORIALS

Javascript

Day Difficulty Challenge Solution
0 Easy Hello, World! hello_world.js
0 Easy Data Types data_types.js
1 Easy Arithmetic Operators arithmetic_operators.js
1 Easy Functions functions.js
1 Easy Let and Const let_and_const.js
2 Easy If else if_else.js
2 Easy Switch switch.js
2 Easy Loops loops.js
3 Easy Arrays arrays.js
3 Easy Try Catch and Finally try_catch_and_finally.js
3 Easy Throw throw.js
4 Easy Create a rectangle object create_a_rectangle_object.js
4 Easy Count Objects count_objects.js
4 Easy Classes classes.js
5 Easy Inheritance inheritance.js
5 Easy Template literals template_literals.js
5 Easy Arrow functions arrow_functions.js
6 Easy Bitwise operators bitwise_operators.js
6 Easy Javascript dates javascript_dates.js
7 Easy Regular expressions I regular_expressions_1.js
7 Easy Regular expressions II regular_expressions_2.js
7 Easy Regular expressions III regular_expressions_3.js
8 Easy Create a button button.js
8 Easy Buttons container buttonsGrid.js
9 Medium Binary calculator binaryCalculator.js

About

Solutions to some of the problems on Hacker rank. Been a while since I've done questions on Hackerrank and some are not updated here. I'm busy with other things and hope to add more solutions in the future.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published