Skip to content

Refactor #566

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/hackerrank/interview_preparation_kit/arrays/crush.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# [Arrays: New Year Chaos](https://www.hackerrank.com/challenges/crush)
# [Arrays: Array Manipulation](https://www.hackerrank.com/challenges/crush)

Perform m operations on an array and print the maximum of the values.

- Difficulty: ` #hard `
- Category: ` #ProblemSolvingIntermediate `
- Difficulty: `#hard`
- Category: `#ProblemSolvingIntermediate` `#arrays`

Starting with a 1-indexed array of zeros and a list of operations, for each
operation add a value to each the array element between two given indices,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

Perform m operations on an array and print the maximum of the values.

- Difficulty: ` #hard `
- Category: ` #ProblemSolvingIntermediate `
- Difficulty: `#hard`
- Category: `#ProblemSolvingIntermediate` `#arrays`

## Solution sources

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

Given an array and a number, d, perform d left rotations on the array.

- Difficulty: #easy
- Category: #ProblemSolvingBasic
- Difficulty: `#easy`
- Category: `#ProblemSolvingBasic` `#arrays`

A left rotation operation on an array shifts each of the array's elements
$ 1 $ unit to the left. For example, if $ 2 $ left rotations are performed
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# [Arrays: New Year Chaos](https://www.hackerrank.com/challenges/minimum-swaps-2)
# [Arrays: Minimum Swaps 2](https://www.hackerrank.com/challenges/minimum-swaps-2)

Return the minimum number of swaps to sort the given array.

- Difficulty: ` #medium `
- Category: ` #ProblemSolvingIntermediate `
- Difficulty: `#medium`
- Category: `#ProblemSolvingIntermediate` `#arrays`

You are given an unordered array consisting of consecutive integers
[1, 2, 3, ..., n] without any duplicates. You are allowed to swap any
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

Determine how many bribes took place to get a queue into its current state.

- Difficulty: ` #medium `
- Category: ` #ProblemSolvingBasic `
- Difficulty: `#medium`
- Category: `#ProblemSolvingBasic` `#arrays`

## Solution sources

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

Determine how many bribes took place to get a queue into its current state.

- Difficulty: ` #medium `
- Category: ` #ProblemSolvingBasic `
- Difficulty: `#medium`
- Category: `#ProblemSolvingBasic` `#arrays`

It is New Year's Day and people are in line for the Wonderland rollercoaster ride.
Each person wears a sticker indicating their initial position in
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# [Dictionaries and Hashmaps: Count Triplets](https://www.hackerrank.com/challenges/count-triplets-1)

- Difficulty: `#medium`
- Category: `#ProblemSolvingIntermediate`
- Category: `#ProblemSolvingIntermediate` `#dictionaries` `#hashmaps`

## Failed tries

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# [Dictionaries and Hashmaps: Count Triplets](https://www.hackerrank.com/challenges/count-triplets-1)

- Difficulty: `#medium`
- Category: `#ProblemSolvingIntermediate`
- Category: `#ProblemSolvingIntermediate` `#dictionaries` `#hashmaps`

You are given an array and you need to find number of
tripets of indices (i, j, k) such that the elements at
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# [Hash Tables: Ransom Notes](https://www.hackerrank.com/challenges/ctci-ransom-note)

- Difficulty: `#easy`
- Category: `#ProblemSolvingIntermediate`
- Category: `#ProblemSolvingIntermediate` `#dictionaries` `#hashmaps`

Harold is a kidnapper who wrote a ransom note, but now he is worried it will be
traced back to him through his handwriting. He found a magazine and wants to
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# [Dictionaries and Hashmaps: Frequency Queries](https://www.hackerrank.com/challenges/frequency-queries)

- Difficulty: `#medium`
- Category: `#ProblemSolvingIntermediate`
- Category: `#ProblemSolvingIntermediate` `#dictionaries` `#hashmaps`

You are given queries. Each query is of the form two integers described below:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# [Sherlock and Anagrams](https://www.hackerrank.com/challenges/mark-and-toys)
# [Sherlock and Anagrams](https://www.hackerrank.com/challenges/sherlock-and-anagrams)

- Difficulty: `#medium`
- Category: `#ProblemSolvingMedium` `#DictionariesAndHashmaps` `#Strings`
- Category: `#ProblemSolvingMedium` `#dictionaries` `#hashmaps` `#strings`

Two strings are [http://en.wikipedia.org/wiki/Anagram](anagrams) of each other
if the letters of one string can be rearranged to form the other string.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# [Two Strings](https://www.hackerrank.com/challenges/two-strings)

- Difficulty: `#easy`
- Category: `#ProblemSolvingBasic`
- Category: `#ProblemSolvingBasic` `#dictionaries` `#hashmaps`

## Clarification

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# [Two Strings](https://www.hackerrank.com/challenges/two-strings)

- Difficulty: `#easy`
- Category: `#ProblemSolvingBasic`
- Category: `#ProblemSolvingBasic` `#dictionaries` `#hashmaps`

Given two strings, determine if they share a common substring.
A substring may be as small as one character.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# [Dynamic Programming: Max Array Sum](https://www.hackerrank.com/challenges/max-array-sum)

- Difficulty: `#medium`
- Category: `#ProblemSolvingIntermediate`
- Category: `#ProblemSolvingIntermediate` `#dynamicprogramming`

## Sources

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# [Dynamic Programming: Max Array Sum](https://www.hackerrank.com/challenges/max-array-sum)

- Difficulty: `#medium`
- Category: `#ProblemSolvingIntermediate`
- Category: `#ProblemSolvingIntermediate` `#dynamicprogramming`

Given an array of integers, find the subset of
non-adjacent elements with the maximum sum.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Help the ruler of HackerLand determine the cheapest way to
give his citizens access to libraries.

- Difficulty: `#medium`
- Category: `#ProblemSolvingAdvanced`
- Category: `#ProblemSolvingAdvanced` `#graphs`

## Solution research

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Help the ruler of HackerLand determine the cheapest way to
give his citizens access to libraries.

- Difficulty: `#medium`
- Category: `#ProblemSolvingAdvanced`
- Category: `#ProblemSolvingAdvanced` `#graphs`

Determine the minimum cost to provide library access to all
citizens of HackerLand.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@

# [Greedy Algorithms: Greedy Florist](https://www.hackerrank.com/challenges/greedy-florist)
# [Greedy Algorithms: Max Min](https://www.hackerrank.com/challenges/angry-children)

- Difficulty: `#medium`
- Category: `#ProblemSolvingBasic`
- Category: `#ProblemSolvingBasic` `#greedyalgorithms`

You will be given a list of integers, `arr`, and a single integer `k`.
You must create an array of length `k` from elements of `arr` such that
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# [Greedy Algorithms: Greedy Florist](https://www.hackerrank.com/challenges/greedy-florist)

- Difficulty: `#medium`
- Category: `#ProblemSolvingBasic`
- Category: `#ProblemSolvingBasic` `#greedyalgorithms`

## About the problem statement

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# [Greedy Algorithms: Greedy Florist](https://www.hackerrank.com/challenges/greedy-florist)

- Difficulty: `#medium`
- Category: `#ProblemSolvingBasic`
- Category: `#ProblemSolvingBasic` `#greedyalgorithms`

A group of friends want to buy a bouquet of flowers.
The florist wants to maximize his number of new customers and the money he makes.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# [Greedy Algorithms: Luck Balance](https://www.hackerrank.com/challenges/luck-balance)

- Difficulty: `#easy`
- Category: `#ProblemSolvingBasic`
- Category: `#ProblemSolvingBasic` `#greedyalgorithms`

Lena is preparing for an important coding competition that is preceded
by a number of sequential preliminary contests.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# [Minimum Absolute Difference in an Array](https://www.hackerrank.com/challenges/minimum-absolute-difference-in-an-array)

- Difficulty: `#medium`
- Category: `#ProblemSolvingBasic`
- Category: `#ProblemSolvingBasic` `#greedyalgorithms`

The absolute difference is the positive difference between two
values `a` and `b`, is written $ \lvert a - b \rvert $
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# [Linked Lists: Detect a Cycle](https://www.hackerrank.com/challenges/ctci-linked-list-cycle)

- Difficulty: `#easy`
- Category: `#ProblemSolvingIntermediate`
- Category: `#ProblemSolvingIntermediate` `#linkedlists`

A linked list is said to contain a cycle if any node is visited more
than once while traversing the list.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# [Linked Lists: Find Merge Point of Two Lists](https://www.hackerrank.com/challenges/find-the-merge-point-of-two-joined-linked-lists)

- Difficulty: `#easy`
- Category: `#ProblemSolvingIntermediate`
- Category: `#ProblemSolvingIntermediate` `#linkedlists`

Given pointers to the head nodes of linked lists that merge together
at some point, find the node where the two lists merge.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# [Linked Lists: Insert a node at a specific position in a linked list](https://www.hackerrank.com/challenges/insert-a-node-at-a-specific-position-in-a-linked-list)

- Difficulty: `#easy`
- Category: `#ProblemSolvingIntermediate`
- Category: `#ProblemSolvingIntermediate` `#linkedlists`

Given the pointer to the head node of a linked list and an integer
to insert at a certain position, create a new node with the given
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Create a node with a given value and insert it into a sorted doubly-linked list

- Difficulty: `#easy`
- Category: `#ProblemSolvingIntermediate`
- Category: `#ProblemSolvingIntermediate` `#linkedlists`

Given a reference to the head of a doubly-linked list and an integer, `data`,
create a new DoublyLinkedListNode object having data value `data` and insert
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Given the head node of a doubly linked list, reverse it.

- Difficulty: `#easy`
- Category: `#ProblemSolvingIntermediate`
- Category: `#ProblemSolvingIntermediate` `#linkedlists`

Given the pointer to the head node of a doubly linked list,
reverse the order of the nodes in place.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# [Miscellaneous: Flipping bits](https://www.hackerrank.com/challenges/flipping-bitse)
# [Miscellaneous: Flipping bits](https://www.hackerrank.com/challenges/flipping-bits)

- Difficulty: `#easy`
- Category: `#ProblemSolvingBasic`
- Category: `#ProblemSolvingBasic` `#BitManipulation`

You will be given a list of 32 bit unsigned integers.
Flip all the bits ( `1 -> 0` and `0 -> 1`)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Find the number of ways to get from the bottom of a staircase
to the top if you can jump 1, 2, or 3 stairs at a time.

- Difficulty: `#medium`
- Category: `#ProblemSolvingIntermediate`
- Category: `#ProblemSolvingIntermediate` `#recursion`

## Failed solution

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Find the number of ways to get from the bottom of a staircase
to the top if you can jump 1, 2, or 3 stairs at a time.

- Difficulty: `#medium`
- Category: `#ProblemSolvingIntermediate`
- Category: `#ProblemSolvingIntermediate` `#recursion`

Davis has a number of staircases in his house and he likes to
climb each staircase `1`, `2`, or `3` steps at a time.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# [The Fibonacci Sequence](https://www.hackerrank.com/challenges/ctci-fibonacci-numbers)

- Difficulty: `#easy`
- Category: `#ProblemSolvingBasic`
- Category: `#ProblemSolvingBasic` `#recursion`

## The Fibonacci Sequence

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# [Recursive Digit Sum](https://www.hackerrank.com/challenges/recursive-digit-sum)

- Difficulty: `#medium`
- Category: `#ProblemSolvingBasic`
- Category: `#ProblemSolvingBasic` `#recursion`

## Language Difficulties

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# [Recursive Digit Sum](https://www.hackerrank.com/challenges/recursive-digit-sum)

- Difficulty: `#medium`
- Category: `#ProblemSolvingBasic`
- Category: `#ProblemSolvingBasic` `#recursion`

We define super digit of an integer `x` using the following rules:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# [Hash Tables: Ice Cream Parlor](https://www.hackerrank.com/challenges/ctci-ice-cream-parlor)

- Difficulty: `#medium`
- Category: `#ProblemSolvingIntermediate`
- Category: `#ProblemSolvingIntermediate` `#search` `#hashtables`

## Failed tries

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# [Search: Hash Tables: Ice Cream Parlor](https://www.hackerrank.com/challenges/ctci-ice-cream-parlor)

- Difficulty: `#medium`
- Category: `#ProblemSolvingIntermediate` `#Hashtables` `#Search`
- Category: `#ProblemSolvingIntermediate` `#search` `#hashtables`

Each time Sunny and Johnny take a trip to the Ice Cream Parlor,
they pool their money to buy ice cream.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# [Hash Tables: Ice Cream Parlor](https://www.hackerrank.com/challenges/ctci-ice-cream-parlor)
# [Swap Nodes [Algo]](https://www.hackerrank.com/challenges/swap-nodes-algo)

Given a tree and an integer, K, we have to swap the subtrees of
all the nodes which are at a depth h

- Difficulty: `#medium`
- Category: `#ProblemSolvingAdvanced`
- Category: `#ProblemSolvingAdvanced` `#search`

A binary tree is a tree which is characterized by one of the following properties:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# [Sorting: Bubble Sort](https://www.hackerrank.com/interview/interview-preparation-kit/sorting)
# [Sorting: Bubble Sort](https://www.hackerrank.com/challenges/ctci-bubble-sort/)

Find the minimum number of conditional checks taking place in Bubble Sort

- Difficulty: `#easy`
- Category: `#ProblemSolvingBasic`
- Category: `#ProblemSolvingBasic` `#sorting`

Consider the following version of Bubble Sort:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Write a Comparator for sorting elements in an array.

- Difficulty: `#medium`
- Category: `#ProblemSolvingBasic`
- Category: `#ProblemSolvingBasic` `#sorting`

Comparators are used to compare two objects.
In this challenge, you'll create a comparator and use it to sort an array.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
You are Mark's best friend and have to help him buy as many toys as possible.

- Difficulty: `#easy`
- Category: `#ProblemSolvingBasic`
- Category: `#ProblemSolvingBasic` `#sorting`

Mark and Jane are very happy after having their first child.
Their son loves toys, so Mark wants to buy some.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# [Balanced Brackets](https://www.hackerrank.com/interview/interview-preparation-kit/sorting)
# [Balanced Brackets](https://www.hackerrank.com/challenges/balanced-brackets/)

Given a string containing three types of brackets, determine if it is balanced.

- Difficulty: `#medium`
- Category: `#ProblemSolvingIntermediate`
- Category: `#ProblemSolvingIntermediate` `#stacksAndQueues`

A bracket is considered to be any one of the following characters:
(, ), {, }, [, or ].
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# [Strings: Making Anagrams](https://www.hackerrank.com/challenges/alternating-characters)
# [Strings: Alternating Characters](https://www.hackerrank.com/challenges/alternating-characters)

- Difficulty: `#easy`
- Category: `#ProblemSolvingBasic`
- Category: `#ProblemSolvingBasic` `#strings`

You are given a string containing characters `A` and `B` only.
Your task is to change it into a string such that there are
Expand Down
Loading