Articles for author: Abhinav Kaushik

Leaders in an Array

Problem Statement Given an array arr of size n with all unique elements. Print all Leaders in the array in any order. Note: A leader is an element of the array if it is greater than all the elements to its right side in the array. The rightmost element is always a leader in an ...

Merge Two Sorted Linked Lists

Problem Statement Given two linked lists which are sorted in increasing order. Merge both lists into a single linked list which is also sorted in increasing order. Example Input : Output: Explanation As we can see that if we merge both lists and arrange them in increasing order, it will become 1->2->3->4->4->6->7->8->9. Constraints $1 <= ...

kth Largest Element in an Array

Problem Statement Given an integer k and an array of size n consisting of unique integers. Find the kth largest element in this array. Examples Input : 1 Output : 1 Input : 1 Output: 2 Explanation Constraints All the elements of the array are unique Approach – 1 : Sorting In this approach, we ...

Check If Two Strings are Anagram

An anagram string is a rearrangement of the letters of a given string to form another word or phrase, using all the original letters exactly once. For example, “listen” and “silent” are string anagrams of each other. In this article, we will be delving into what is anagram string. Problem Statement Given two strings consisting ...

What is the Structure or Format of Data Called?

The structure or format of data is called the Syntax, which is defined by various combinations of pre-defined symbols in a programming language. What is Syntax? A Syntax in a programming language is the set of rules that defines a particular language, by defining the correct arrangements of the symbols which are pre-defined in a particular language eg: “;” , “->” , ...

Complete Roadmap To Learn DSA

Data Structures and Algorithms is the most important subject in the world of Software and Computer Science. Data Structures and Algorithms are the base of every application which is built using coding, it can be a web application or a mobile application. It is used to solve any problem most efficiently. The **utilization of time and space ** ...

Remove Duplicates from String

Problem Statement Given a string, we have to remove duplicate characters from the string such that each character appears only once (all the characters in the string should become unique). We can print the resultant string in any order. Example Input : “aaabbccd”Output : “abcd” Explanation As we can see the frequency of all the ...

Remove Duplicates from Array

Problem Statement Given an array of integers, we have to remove duplicates from array such that each element in the array appears only once (all the values in the array should become unique). Example Input : [1,2,2,3,4,4,4,5,5] Output : [1,2,3,4,5] Explanation As we can see the frequency of all the elements Element Frequency 1 1 2 2 3 1 ...