hackerrank-solution

Set .discard(), .remove() & .pop() HackerRank Solution in Python

Problem .remove(x) This operation removes element x from the set. If element x does not exist, it raises a KeyError. The .remove(x) operat...

Ankur Ranpariya 11 Feb, 2023

Word Order HackerRank Solution in Python

Problem You are given n words. Some words may repeat. For each word, output its number of occurrences. The output order should correspond w...

Ankur Ranpariya 10 Feb, 2023

itertools.combinations_with_replacement() HackerRank Solution in Python

itertools.combinations_with_replacement(iterable, r) This tool returns r length subsequences of elements from the input iterable allowing i...

Ankur Ranpariya 9 Feb, 2023

Set .add() HackerRank Solution in Python

Problem If we want to add a single element to an existing set, we can use the .add() operation. It adds the element to the set and returns ...

Ankur Ranpariya 8 Feb, 2023

Incorrect Regex HackerRank solution in Python

In this article, we will solve the HackerRank problem using python programming. Problem You are given a string S . Your task is to find out ...

Ankur Ranpariya 7 Feb, 2023

itertools.combinations() HackerRank solution in python

itertools.combinations(iterable, r) This tool returns the r length subsequences of elements from the input iterable. Combinations are emitt...

Ankur Ranpariya 5 Jun, 2022

Symmetric Difference in python | HackerRank Solution

Problem Objective Today, we're learning about a new data type: sets. Concept If the inputs are given on one line separated by a characte...

Ankur Ranpariya 15 May, 2022

Collections.OrderedDict() in python | HackerRank Solution

Problem An OrderedDict is a dictionary that remembers the order of the keys that were inserted first. If a new entry overwrites an existing ...

Ankur Ranpariya 14 May, 2022

No Idea! in python - HackerRank Solution

Problem There is an array of n integers. There are also 2 disjoint sets , A and B , each containing m integers. You like all the integers...

Ankur Ranpariya 26 Mar, 2022

Find Angle MBC in python - HackerRank Solution

Problem Therefore, Angle ABC = 90 . Point M is the midpoint of hypotenuse AC . You are given the lengths AB and BC . Your task is to find ...

Ankur Ranpariya 17 Jan, 2022