Beautiful Days at the Movies | Hackerrank Solutions
Lily likes to play games with integers. She has created a new game where she determines the difference between a number and its reverse. For instance, given the number 12,…
Code in a Better Way
Lily likes to play games with integers. She has created a new game where she determines the difference between a number and its reverse. For instance, given the number 12,…
Finding the top ( k ) most frequent elements in an array is a common question in coding interviews and a useful task in various applications like data analysis and…
In many coding interviews and real-world applications, finding the top ( k ) largest elements in an array is a common problem. This tutorial will guide you through three popular…
Introduction: In the realm of algorithmic problem-solving, the quest for the maximum sum of any contiguous subarray within a given array is a classic challenge. In this tutorial, we’ll embark…
Introduction: Dynamic Programming (DP) is a powerful algorithmic technique used to solve a variety of optimization problems. One classic problem where DP shines is in finding the longest palindromic subsequence…
You are given a string ‘S’. Your task is to check whether the string is palindrome or not. For checking palindrome, consider alphabets and numbers only and ignore the symbols…
Unstructured data files consist of a series of bits. The file doesn’t separate the bits from each other in any way. You can’t simply look into the file and see…
In many cases, the data you need to work with won’t appear within a library, such as the toy datasets in the Scikit-learn library. Real-world data usually appears in a…
The Utopian Tree goes through 2 cycles of growth every year. Each spring, it doubles in height. Each summer, its height increases by 1 meter. A Utopian Tree sapling with…
A video player plays a game in which the character competes in a hurdle race. Hurdles are of varying heights, and the characters have a maximum height they can jump.…
By default, the Gini impurity measure is used, but you can select the entropy impurity measure instead by setting the criterion hyperparameter to “entropy”. The concept of entropy originated in…
Introduction During model development, one of the techniques that many don’t experiment with is feature discretization. The core idea is to transform a continuous feature into discrete features, mostly one-hot…
Least Absolute Shrinkage and Selection Operator Regression (simply called Lasso Regression) is another regularized version of Linear Regression: just like Ridge Regression, it adds a regularization term to the cost…
As we saw in previous posts, a good way to reduce overfitting is to regularize the model (i.e., to constrain it): the fewer degrees of freedom it has, the harder…
Two cats and a mouse are at various positions on a line. You will be given their starting positions. Your task is to determine which cat will reach the mouse…
Given a square matrix, calculate the absolute difference between the sums of its diagonals. For example, the square matrix is shown below: The left-to-right diagonal =1+5+9=15. The right to left…
Alice and Bob each created one problem for HackerRank. A reviewer rates the two challenges, awarding points on a scale from 1 to 100 for three categories: problem clarity, originality,…
Introduction Till now, We have read about Gradient Descent,Min-Batch Gradient Descent,Stochastic Gradient Descent and other type of Gradient Descents. In this post we will learn about Polynomial Regression. What if…
What is Dataset? Datasets are container of data in python. It can work as data storage for the various algorithms in python. and also a primary storage of data in…