Found 34494 Articles for Programming

Numbers having difference with digit sum more than s

Prabhdeep Singh
Updated on 01-Sep-2023 10:04:48

180 Views

The digit sum for a given number is the sum of all the digits present in the given number. We will be given a number n and s and we have to find all the numbers which are in the range 1 to n and have the difference between the number and the sum of its digits greater than s. We will implement two approaches with the code and the discussion on time and space complexity. Input N = 15, S = 5 Output 6 Explanation For all the numbers in the range 0 to 9, the difference ... Read More

Sort 1 to N by swapping adjacent elements

Prabhdeep Singh
Updated on 01-Sep-2023 10:15:24

222 Views

An array is a linear data structure that stores the elements and a sorted array contains all the elements in increasing order. Sorting an array by swapping the adjacent elements means we can swap the adjacent elements any number of times and we have to sort the array. We will be given two array’s first array is the array to be sorted and another array is a Boolean array that represents whether the current element is swappable or not. If the given array is of the length N then all the elements present will be from 1 to N. ... Read More

Back-Face Detection Method

Prabhdeep Singh
Updated on 01-Sep-2023 09:54:53

3K+ Views

Programming languages are used for many purposes such as making websites, developing mobile applications, etc. Graphic designing is one of the things that we can do by using the programming language. While graphic designing, we can face a problem where we have to project a 3-D object on the 2-D plane and due to which one dimension will be reduced or one face will be hidden. In this problem, we have to detect that hidden face. Back-Face detection is also known as the name Plane Equation method, and it is a method for the object space methods in which objects ... Read More

Largest number in [2, 3, .. n] which is co-prime with numbers in [2, 3, .. m]

Prabhdeep Singh
Updated on 01-Sep-2023 09:49:52

71 Views

Co-prime numbers are numbers that do not have any common divisor other than 1. We will be given two numbers n and m. We have to find the largest number in the range of 2 to n (both inclusive) which is co-prime with all the elements in the range of 2 to m (both inclusive). If none of the elements in the given range is co-prime with all the elements of the second range then we have to return or print -1. We will implement the approach, and code, and will discuss the time and space complexity of the program. ... Read More

P – smooth numbers in given ranges

Prabhdeep Singh
Updated on 01-Sep-2023 09:46:40

96 Views

P smooth numbers are the numbers that have the maximum prime number that can divide them is less than or equal to the given number P. Prime numbers are the numbers that are divisible by only 1 and that number. 1 is by default considered as the P - smooth number for any given value of P. In this problem, we will be given a value P and the range and we have to return the number of elements that are present in that range and are P-smooth. Input Given the value of P is 7 and the range ... Read More

Building a Simple Game in Python using the PyGame Module

S Vijay Balaji
Updated on 31-Aug-2023 18:18:06

586 Views

Pygame is a good game development library since it includes a variety of built-in tools and functions that can be used to create games of various genres, from simple to complicated. The library comprises graphics, sound, and input processing, all of which are required for any game. The ability to create and alter sprites is one of Pygame's most remarkable capabilities. Sprites are graphical objects that depict the game's characters, objects, and other game features. Pygame includes a robust sprite class that allows the developer to incorporate graphics and animations into the game, move and rotate the sprites, and detect ... Read More

Building a Recommendation Engine in Python Using the LightFM library

S Vijay Balaji
Updated on 31-Aug-2023 18:42:01

319 Views

Recommendation engines are one of the most popular applications of machine learning in the real world. With the growth of e-commerce, online streaming services, and social media, recommendation engines have become a critical component in providing personalized content and recommendations to users. In this tutorial, we will learn how to build a recommendation engine using the LightFM library. LightFM is a Python library that allows you to build recommender systems with both explicit and implicit feedback, such as ratings or user interactions. It is a hybrid recommender system that can handle both content-based and collaborative filtering approaches. LightFM is built ... Read More

Building a Real-Time Object Detection System with YOLO Algorithm

S Vijay Balaji
Updated on 31-Aug-2023 18:40:51

352 Views

In recent years, the field of computer vision has witnessed remarkable advancements, with real-time object detection being one of the most exciting and impactful areas. Real-time object detection refers to the ability to detect and identify objects in images or videos in real-time, enabling a wide range of applications such as autonomous vehicles, surveillance systems, augmented reality, and more. In this tutorial, we will explore how to build a real-time object detection system using Python and the YOLO (You Only Look Once) algorithm. The YOLO algorithm revolutionized object detection by introducing a single, unified approach that performs both object localization ... Read More

Building a Question Answering System with Python and BERT

S Vijay Balaji
Updated on 31-Aug-2023 18:38:01

895 Views

In the realm of natural language processing (NLP), question answering systems have gained significant attention and have become an integral part of many applications. These systems are designed to understand human language and provide accurate responses to user queries, mimicking human-like interaction and enhancing user experiences. One such powerful model that has revolutionized the field of NLP is BERT (Bidirectional Encoder Representations from Transformers). Bidirectional Encoder Representations from Transformers, developed by Google, stands as a state-of-the-art NLP model known for its remarkable performance on various NLP tasks, including question answering. BERT's key innovation lies in its ability to capture the ... Read More

Building a Machine Learning Model for Customer Churn Prediction with Python and Scikit-Learn

S Vijay Balaji
Updated on 31-Aug-2023 18:39:58

354 Views

In today's highly competitive business landscape, customer churn (the loss of customers) is a critical challenge that many companies face. Being able to predict which customers are at risk of churning can help businesses take proactive measures to retain those customers and maintain long-term profitability. In this article, we will explore how to build a machine learning model for customer churn prediction using Python and the scikit-learn library. The customer churn prediction model that we will develop aims to analyze customer data and predict whether a customer is likely to churn or not. By leveraging the power of machine learning ... Read More

Advertisements