In the realm of data structures, Linked list, array can be described as a linear data structure unlike trees which are non-linear, hierarchical data structures.

A tree can be defined as a collection of nodes in which node stores a value and a list referencing to children nodes. …

Given the head of a singly linked list, reverse the list, and return the reversed list.

Image of reversed linked list.

A easy category linked list problem where we need to reverse the Linked list.For this there are two method-iterative and recurrssive method.Here we will apply the iterative method. For this method we will need…

Problem:-The distance between two array values is the number of indices between them. Given a, find the minimum distance between any pair of equal elements in the array. If no such value exists, return -1.

Problem Statement:-
There is a string ”s”, of lowercase English letters that is repeated infinitely many times. Given an integer ,”n”. Find and print the number of letter “a” in string “s” in the first “ n” letters of the infinite string.

Photo by Crawford Jolly on Unsplash

Interesting hackerrank problem where we need to find…

Problem statement:-

Solution:-Simple but not so straight forward hackerrank problem where we have to count the number of jumps based on which type of cloud is allowed to jump on it or not in that case the jump range will increase.

Parag Naik

Work in progress

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store