Hackerrank Solutions
Hackerrank je stránka, kde si môžte testovať svoje vedomosti a znalosti z programovania a naučiť sa niečo nové v rôznych oblastiach.
Túto stránku som objavil okolo roku 2014 a odvtedy si namáham svoje mozgové závity pre zábavu. Tu si môžte pozrieť môj profil.
Takmer každé riešenie obsahuje implementácie v 4 programovacích jazykoch – Scala, Javascript, Java a Ruby. Niektoré riešenia, vzhľadom na oblasť, sú v SQL, Bash, alebo obsahujú len čisto textovú odpoveď. Taktiež obsahujú slovný popis riešenia.
Zoznam dodržuje štruktúru Hackerrank. Všetky implementácie je možné nájsť aj na mojom Github profile.
Project Euler+
- Project Euler #1: Multiples of 3 and 5
- Project Euler #2: Even Fibonacci numbers
- Project Euler #3: Largest prime factor
- Project Euler #4: Largest palindrome product
- Project Euler #5: Smallest multiple
- Project Euler #6: Sum square difference
- Project Euler #7: 10001st prime
- Project Euler #8: Largest product in a series
- Project Euler #9: Special Pythagorean triplet
- Project Euler #10: Summation of primes
- Project Euler #11: Largest product in a grid
- Project Euler #12: Highly divisible triangular number
- Project Euler #13: Large sum
- Project Euler #14: Longest Collatz sequence
- Project Euler #15: Lattice paths
- Project Euler #16: Power digit sum
- Project Euler #17: Number to Words
- Project Euler #18: Maximum path sum I
- Project Euler #19: Counting Sundays
- Project Euler #20: Factorial digit sum
- Project Euler #22: Names scores
- Project Euler #36: Double-base palindromes
- Project Euler #67: Maximum path sum II
Algorithms
Warmup
- [Easy] Solve me first (1 bod)
- [Easy] Simple Array Sum (10 bodov)
- [Easy] Staircase (10 bodov)
- [Easy] Diagonal Difference (10 bodov)
- [Easy] A Very Big Sum (10 bodov)
- [Easy] Plus Minus (10 bodov)
- [Easy] Time Conversion (15 bodov)
- [Easy] Compare The Triples (10 bodov)
- [Easy] Circular Array Rotaiion (20 bodov)
- [Easy] Birthday Cake Candles (10 bodov)
Implementation
- [Easy] Divisible Sum Pairs (10 bodov)
- [Easy] Sequence Equation (20 bodov)
- [Easy] Lisa’s Workbook (30 bodov)
- [Easy] Library Fine (15 bodov)
- [Easy] Caesar Cipher (15 bodov)
- [Easy] Angry Professor (20 bodov)
- [Medium] Extra long factorials (20 bodov)
- [Easy] Service Lane (20 bodov)
- [Easy] Utopian Tree (20 bodov)
- [Easy] Chocolate Feast (25 bodov)
- [Easy] Modified Kaprekar Numbers (30 bodov)
- [Easy] Sherlock and Squares (20 bodov)
- [Easy] Manasa and Stones (30 bodov)
- [Easy] Cut the sticks (25 bodov)
- [Easy] Find Digits (25 bodov)
- [Easy] Cavity Map (30 bodov)
- [Easy] Sherlock and The Beast (30 bodov)
- [Medium] Encryption (30 bodov)
- [Easy] Strange Counter (30 bodov)
- [Easy] Beautiful Triplets (20 bodov)
- [Easy] Kangaroo (10 bodov)
- [Easy] Save the Prisoner! (15 bodov)
- [Easy] Minumum Distances (20 bodov)
- [Easy] Jumping on the Clouds (20 bodov)
- [Easy] Jumping on the Clouds: Revisited (15 bodov)
- [Easy] Sock Merchant (10 bodov)
- [Easy] Repeated String (20 bodov)
- [Easy] Equalize the Array (20 bodov)
- [Easy] Viral Advertising (15 bodov)
- [Easy] Apple and Orange (10 bodov)
- [Easy] Mini-Max Sum (10 bodov)
- [Easy] Bon Appétit (10 bodov)
- [Easy] Beautiful Days at the Movies (15 bodov)
- [Easy] Designer PDF Viewer (20 bodov)
- [Easy] Flatland Space Stations (25 bodov)
- [Easy] Grading Students (10 bodov)
- [Easy] Between Two Sets (10 bodov)
- [Easy] The Hurdle Race (15 bodov)
- [Easy] Taum and B’day (25 bodov)
- [Easy] ACM ICPC Team (25 bodov)
- [Easy] Drawing Book (10 bodov)
- [Easy] Day of the Programmer (15 bodov)
- [Easy] Electronics Shop (15 bodov)
- [Easy] Migratory Birds (10 bodov)
- [Easy] Picking Numbers (20 bodov)
- [Easy] Birthday Chocolate (10 bodov)
- [Easy] Breaking the Records (10 bodov)
- [Easy] Cats and a Mouse (15 bodov)
- [Easy] Counting Valleys (15 bodov)
Strings
- [Easy] Super Reduced String (10 bodov)
- [Easy] CamelCase (15 bodov)
- [Easy] The Love-Letter Mystery (20 bodov)
- [Easy] Alternating Characters (20 bodov)
- [Easy] Gemstones (20 bodov)
- [Easy] Pangrams (20 bodov)
- [Easy] Game of Thrones – I (30 bodov)
- [Easy] Funny String (25 bodov)
- [Easy] Anagram (25 bodov)
- [Easy] Beautiful Binary String (20 bodov)
- [Easy] Mars Exploration (15 bodov)
- [Easy] String Construction (25 bodov)
- [Easy] Weighted Uniform Strings (20 bodov)
- [Easy] Two Characters (20 pts)
- [Easy] Separate the Numbers (20 pts)
- [Easy] Making Anagrams (30 pts)
- [Medium] Sherlock and Anagrams (50 bodov)
- [Difficult] Common Child (60 bodov)
Sorting
- [Easy] Intro to Tutorial Challenges (30 bodov)
- [Easy] Insertion Sort – Part 1 (30 bodov)
- [Easy] Insertion Sort – Part 2 (30 pts)
- [Easy] Counting Sort 1 (30 pts)
- [Easy] Closest Numbers (35 bodov)
Search
Graph Theory
Greedy
- [Medium] Flowers (35 bodov)
- [Medium] Max Min (35 bodov)
- [Easy] Two Arrays (40 bodov)
- [Easy] Priyanka and Toys (30 bodov)
- [Easy] Mark and Toys (35 bodov)
Dynamic Programming
Bit Manipulation
- [Easy] Lonely Integer (20 bodov)
- [Easy] Maximizing XOR (30 bodov)
- [Easy] Flipping Bits (40 bodov)
- [Easy] Sum vs XOR (25 bodov)
Data Structures
Arrays
Linked Lists
Mathematics
Fundamentals
- [Easy] Find Point (5 bodov)
- [Easy] Minimum Draws (5 bodov)
- [Easy] Connecting Towns (10 bodov)
- [Easy] Handshake (10 bodov)
- [Easy] Halloween Party (20 bodov)
- [Easy] Filling Jars (20 bodov)
- [Medium] Is Fibo (20 bodov)
Number Theory
Combinatorics
- [Expert] Building a List (40 bodov)
- [Easy] Picking Cards (50 bodov)
- [Medium] Consecutive Subsequences (50 bodov)
Probability
Java
Introduction
- [Easy] Welcome To Java! (3 bodov)
- [Easy] Java If-Else (10 bodov)
- [Easy] Java Stdin and Stdout 1 (5 bodov)
- [Easy] Java Stdin and Stdout 2 (10 bodov)
- [Easy] Java Output Formatting (10 bodov)
- [Easy] Java Loops I (10 bodov)
- [Easy] Java Loops II (10 bodov)
- [Easy] Java Datatypes (10 bodov)
- [Easy] Java End-of-file (10 bodov)
- [Easy] Java Static Initializer Block (10 bodov)
- [Easy] Java Int to String (10 bodov)
- [Easy] Java Date and Time (15 bodov)
- [Easy] Java Currency Formatter (15 bodov)
Strings
SQL
Basic Select
- [Easy] Select All (10 bodov)
- [Easy] Revising the Select Query – 1 (10 bodov)
- [Easy] Revising the Select Query – 2 (10 bodov)
- [Easy] Select by ID (10 bodov)
- [Easy] Japanese Cities‘ Detail (10 bodov)
- [Easy] Japanese Cities‘ Names (10 bodov)
- [Easy] Weather Observation Station 1 (15 bodov)
- [Easy] Weather Observation Station 3 (10 bodov)
- [Easy] Weather Observation Station 4 (10 bodov)
- [Medium] Weather Observation Station 5 (30 bodov)
- [Easy] Weather Observation Station 6 (10 bodov)
- [Easy] Weather Observation Station 7 (10 bodov)
- [Easy] Weather Observation Station 8 (15 bodov)
- [Easy] Weather Observation Station 9 (10 bodov)
- [Easy] Weather Observation Station 10 (10 bodov)
- [Easy] Weather Observation Station 11 (15 bodov)
- [Easy] Weather Observation Station 12 (15 bodov)
- [Medium] Higher Than 75 Marks (15 bodov)
Linux Shell
Bash
- [Easy] Let’s Echo (1 bod)
- [Easy] Looping and Skipping (2 body)
- [Easy] A Personalized Echo (1 bod)
- [Easy] Looping with Numbers (2 body)
- [Easy] The World of Numbers (2 body)
- [Easy] Comparing Numbers (3 bodov)
- [Easy] Getting started with conditionals (3 bodov)
Text Processing
- [Easy] Cut #1 (1 bod)
- [Easy] Cut #2 (1 bod)
- [Easy] Head of a Text File #1 (2 body)
- [Easy] Head of a Text File #2 (2 body)
- [Easy] Tr‘ Command #1 (1 bod)
- [Easy] Sort Command #1 (1 bod)
- [Easy] Sort Command #2 (1 bod)
- [Easy] Tr‘ Command #2 (1 bod)
Grep Sed Awk
Functional Programming
Introduction
- [Easy] Solve me first FP (3 bodov)
- [Easy] Lambda Calculus – Evaluating Expressions #1 (5 bodov)
- [Easy] Lambda Calculus – Evaluating Expressions #2 (5 bodov)
- [Easy] Lambda Calculus – Evaluating Expressions #3 (5 bodov)
- [Medium] Lambda Calculus – Evaluating Expressions #4 (5 bodov)
- [Medium] Lambda Calculus – Evaluating Expressions #5 (5 bodov)
- [Easy] Lambda Calculus – Reductions #1 (5 bodov)
- [Easy] Lambda Calculus – Reductions #2 (5 bodov)
- [Medium] Lambda Calculus – Reductions #3 (5 bodov)
- [Medium] Lambda Calculus – Reductions #4 (5 bodov)
- [Easy] Hello World (5 bodov)
- [Easy] Hello World N Times (5 bodov)
- [Easy] List Replication (10 bodov)
- [Easy] Filter Array (10 bodov)
- [Easy] Update List (10 bodov)
- [Easy] List Length (10 bodov)
- [Easy] Array Of N Elements (10 bodov)
- [Easy] Reverse a list (10 bodov)
- [Easy] Sum of odd elements (10 bodov)
- [Easy] Filter positions in a list (10 bodov)
- [Easy] Evaluating e^x (20 bodov)
- [Easy] Area Under Curves and Volume of Revolving a Curve (30 bodov)
- [Easy] Functions or Not (5 bodov)
- [Easy] Compute the Perimeter of a Polygon (15 bodov)
- [Easy] Compute the Area of a Polygon (20 bodov)
Recursion
- [Easy] Computing the GCD (2 body)
- [Easy] Fibonacci Numbers (2 body)
- [Easy] Pascal’s Triangle (10 bodov)
- [Easy] String Mingling (20 bodov)
- [Easy] String-o-Permute (10 bodov)
- [Easy] String Reductions (10 bodov)
- [Easy] Prefix Compression (10 bodov)
- [Easy] Sequence full of colors (10 bodov)
- [Easy] String Compression (10 bodov)
- [Medium] Super Digit (20 bodov)
Ad Hoc
- [Easy] Remove Duplicates (10 bodov)
- [Easy] Rotate String (20 bodov)
- [Easy] Jumping Bunnies (20 bodov)
- [Easy] Missing Numbers (FP) (30 pts)
Regex
Introduction
- [Easy] Matching Specific String (5 bodov)
- [Easy] Matching Word & Non-Word Character (5 bodov)
- [Easy] Matching Digits & Non-Digit Characters (5 bodov)
- [Easy] Matching Whitespace & Non-Whitespace Character (5 bodov)
- [Easy] Matching Anything But a Newline (5 bodov)
- [Easy] Matching Start & End (5 bodov)
Character Class
- [Easy] Matching Specific Characters (10 bodov)
- [Easy] Excluding Specific Characters (10 bodov)
- [Easy] Matching Range Of Characters (10 bodov)
Repetitions
- [Easy] Matching {x} Repetitions (20 bodov)
- [Easy] Matching {x,y} Repetitions (20 bodov)
- [Easy] Matching Zero Or More Repetitions (20 bodov)
- [Easy] Matching One Or More Repetitions (20 bodov)
- [Easy] Matching Ending Items (20 bodov)
Grouping and Capturing
- [Easy] Matching Word Boundaries (20 bodov)
- [Easy] Capturing & Non-Capturing Groups (20 bodov)
- [Easy] Alternative Matching (20 bodov)
Applications
- [Easy] HackerRank Tweets (5 bodov)
- [Easy] Split the Phone Numbers (5 bodov)
- [Easy] Find Hackerrank (5 bodov)
- [Easy] The British and American Style of Spelling (5 bodov)
- [Easy] Find a Substring (5 bodov)
- [Easy] Alien Username (5 bodov)
- [Easy] Detecting Valid Latitude and Longitude Pairs (20 bodov)
- [Easy] Valid PAN Format (5 bodov)
- [Easy] IP Address Validation (10 bodov)
- [Easy] Detect HTML Attributes (10 bodov)
- [Easy] Detect HTML Tags (10 bodov)