Server Side Programming Articles - Page 206 of 2650

PHP Program for Converting Roman Numerals to Decimal Lying Between 1 to 3999

Prabhdeep Singh
Updated on 11-Jul-2023 18:08:03

254 Views

The characters used in an arrangement of numeric notation based on the pre-Roman Roman system are known as Roman numerals. All major symbols are covered in the section below. In this problem, we are given a string of Roman numerals and our task is to convert Roman numerals to decimals in the range of 1 to 3999 Here are some examples and explanations to help you better understand the problem. Input str = "DCCCLXXIV" Output str = 874 Explanation DCCC is the Roman representation of 800 as D represents 500 and C represents 100 LXX is the Roman representation of ... Read More

How to Configure Nginx as Reverse Proxy for Nodejs App?

Satish Kumar
Updated on 11-Jul-2023 16:45:16

1K+ Views

Introduction Nginx and Nodejs are two powerful tools that web developers use to build modern web applications. Nginx is a high-performance, open-source web server that can also function as a reverse proxy, caching server, load balancer, and more. Nodejs is a JavaScript runtime built on the Chrome V8 engine that allows developers to create fast and scalable network applications. The First Step: Installing and Configuring Nginx A Step-By-Step Guide to Installing Nginx on the Server Before you can configure Nginx as a reverse proxy for your Nodejs app, you need to install it. The installation process varies depending on your ... Read More

Python Program To Write Your Own atoi()

Prabhdeep Singh
Updated on 11-Jul-2023 17:08:47

545 Views

We are given a string that may represent a number and if it is a valid number then we have to convert it into an integer using the Python programming language. atoi() function is used in C programming language and used to convert the string which is passed as the parameter to it into an integer value if the string is a valid integer otherwise it shows the undefined behavior. Sample Examples Input 1 string S = "9834" Output 9834 Explanation We are given a string that represents a number so we have just got the same output. ... Read More

How to Disable root Login Access to PhpMyAdmin?

Satish Kumar
Updated on 11-Jul-2023 16:10:27

2K+ Views

Introduction PhpMyAdmin is a popular open-source tool used to manage MySQL databases. It provides a web interface that allows users to interact with the database through their web browser. One of the default login options for PhpMyAdmin is root login access, which grants a user full administrative privileges over the entire database system. While root login access may be convenient for initial setup and configuration, it poses significant security risks. If an attacker gains access to your root credentials, they can cause irreparable damage to your database or steal sensitive information. Explanation of Root Login Access The root user account ... Read More

C Program to Find Minimum Insertions to Form a Palindrome

Prabhdeep Singh
Updated on 11-Jul-2023 16:57:21

431 Views

A palindrome is a string that is just equal to the reverse of it. We are given a string and we have to find the minimum number of insertions of any characters required to make the given string as the palindrome. We will see the three approaches: first recursive approach, then we will memorize this solution, and last, we will implement the dynamic programming approach. Recursive ApproachExample #include // library for input and output #include // library to get the integer limits #include // library for strings // function to find the minimum of ... Read More

Convert a Binary String to Another by Flipping Prefixes a Minimum Number of Times

Prabhdeep Singh
Updated on 11-Jul-2023 16:24:09

283 Views

Prefixes are the substrings that start from the zeroth index and could be of any size from 1 to the length of the given string. We are given two binary string which means both strings contain only two different types of characters and we have to make the first string equal to the second one by flipping the prefix a minimum number of times. Also, it is given that the length of both of the given strings is equal. Input 1 string str1 = "01100" string str2 = "10101" Output 3 Explanation Only operation that we can perform ... Read More

Python Program for Converting Roman Numerals to Decimal Lying Between 1 to 3999

Prabhdeep Singh
Updated on 11-Jul-2023 21:34:23

730 Views

Roman numerals are known as the characters used in an arrangement of number notation based on the pre-Roman Roman system. All major symbols are covered in the section below. In this problem, we are given a string of Roman numerals and our task is to convert Roman numerals to decimals in the range of 1 to 3999 Here are some examples and explanations to help you better understand the problem. Input str = “MXCIX” Output 1099 Explanation M is the Roman representation of 1000, XC is the Roman representation of 90, IX is the Roman representation of 9. Input str ... Read More

Largest Roman Numeral Possible by Rearranging Characters of a Given String

Prabhdeep Singh
Updated on 11-Jul-2023 16:07:53

223 Views

The characters represent Roman numbers: 'I', 'V', 'X', 'L', 'C', 'D', and 'M'. We will be given a string that may contain another character also (all the characters will be uppercase English alphabets) and we have to find the largest Roman numerical number possible by altering the position of the characters of the given string, also if it is not possible to get one, then we will return invalid as the answer. Input 1 string str = “VICML” Output MCLVI Explanation In the given string we have M have the greater value followed by the C, and then all ... Read More

Karatsuba Algorithm for Fast Multiplication of Large Decimal Numbers Represented as Strings

Prabhdeep Singh
Updated on 11-Jul-2023 21:20:07

562 Views

We are not able to store the large decimal numbers in normal data types such as the int or even in long long, so we store them in the string. When we multiply two integers represented in the form of a string it takes a lot of time more specifically N*M where N is the size of the given string. In this article, we will implement Karatsuba Algorithm for the fast Multiplication of large decimal numbers represented as strings. Input string num1 = "34984" string num2 = "937488" Output 32797080192 Explanation We will see the algorithm for the ... Read More

Python3 Program to Minimize Characters to be Changed to Make the Left and Right Rotation of a String the Same

Prabhdeep Singh
Updated on 11-Jul-2023 15:05:05

131 Views

Rotation means we have to shift each character either in a forward direction or backward direction. Forward direction means right rotation (Or anticlockwise) and backward direction means left rotation (Or clockwise). In this problem, we have given a string of size n. Our task is to find the minimum number of the character to be changed to check whether it is possible to the make left rotation and right rotation of a string the same. Let's see examples with explanations below to understand the problem in a better way. Input 1 str = "wxyz" Output 1 2 Explanation The ... Read More

Advertisements