6 days agoHow to Solve nCr%p?Problem Statement We are given three integers n, r, and p, we have to find the value of nCr%p. Here p is a natural number greater than n and nCr is the Binomial Coefficient. Examples Input: n = 10, r = 2, p = 13 Output: 6 Explanation: 10C2 is 45 and 45…Data Structure Algorithm3 min read
Jul 5What is HashMap in Java — Explained with examples.HashMap in Java is a part of Java Collections Frameworks since Java 1.2 and provides the basic implementation of the Map interface in Java. It stores data in the form of Key and Value pairs where the key is a unique identifier used to associate each value on the Map…Java3 min read
Jun 9How to Sort an Array of 0s, 1s, and 2s in JavaGiven an array A[] of 0s, 1s, and 2s of size N, the task is to write a function that can sort an array of 0s, 1s, and 2s in ascending order such that 0s are in the beginning followed by all 1s and then 2s at the end, and…Data Structure Algorithm2 min read
Published in Javarevisited·May 30How to Rotate an Array in Java | TekolioIn this blog, we will learn what exactly array rotation is? And how to rotate an array either in the left or the right direction. Here rotation only means shifting the elements of the array in the desired direction. Example Input : Arr[] = [1, 2, 3, 4, 5] k=2 Output…Dsa5 min read
May 21How to calculate Leaders in an ArrayLeaders in an array are those elements that are greater than the elements on their right-hand side in the array. This is by default true for the last element as the array end at that element and we can’t compare it with anyone. Difficulty Level — Easy Asked in —…Algorithms2 min read
May 15React Create Element — React Without JSXReact has taken the top spot among all other JS frameworks and libraries, according to the StackOverflow survey, 2021. The reason might be anything from being open-source to flexible (it can work with any other package or library to create an awesome app) or having JSX as its syntax which…Reactjs2 min read
May 4What are Arrays in Java?An array is a type of data structure that can store a fixed number of elements of the same data types in our RAM in contiguous order, and Arrays in Java are no exception. It has the same features as any other array except that in Java, an array is…Java4 min read
Published in Frontend Weekly·Apr 12How to Make a Custom Hook in React | TekolioIn functional components, we can do everything with the help of hooks, mainly the useState and the useEffect hook, but the power that hooks have given us has gone beyond our imagination. Here we can even make Custom Hook(s) and use them in our apps like other hooks. Pretty similar…Reactjs11 min read
Apr 10How to Make an Image Search App in React using the Unsplash APIIn this tutorial, we will make an Image Search App using the Unsplash API to get access to its enormous collection of images and also download them. Before starting the development part of our app, let’s see how it will look exactly. Let’s start… Contents How to Create the React App …Unsplash3 min read
Apr 4Time Complexity of Algorithms Explained with ExamplesThere are indeed multiple ways of solving any problem that we might face, but the question comes down to which one among them is the best and should be chosen. But let’s focus only on algorithms, the best way to find the right solution for a specific problem is by…Time Complexity4 min read