Parity of Count of Letters with Same Parity in Position and Frequency

Shubham Vora
Updated on 17-Jul-2023 16:32:47

215 Views

In this problem, we will count the number of characters whose frequency and position have the same parity and print the count of the number as odd or even. To solve the problem, we can find the frequency of each character in the string, and count total characters whose freqeuncy and position have the same parity. After that, we can print the odd or even answer based on the counts. Problem statement − We have given a string alpha containing only lowercase english alphabetical characters. We need to check whether the number of characters having equal parity of their alphabetical ... Read More

Install MongoDB Community Edition 4.0 on Linux

Satish Kumar
Updated on 17-Jul-2023 16:31:43

2K+ Views

Introduction MongoDB is a popular open-source NoSQL database management system known for its scalability, flexibility, and ease of use. If you're using a Linux operating system and looking to install MongoDB Community Edition 4.0, this article will provide you with a detailed guide accompanied by examples and the corresponding command outputs. Prerequisites Before proceeding with the installation, ensure that you have the following prerequisites − A Linux-based operating system (e.g., Ubuntu, CentOS, or Debian). Root or sudo privileges. An active internet connection. Step 1: Import the MongoDB GPG Key To begin the installation process, we first need to ... Read More

Install LXC Linux Containers in RHEL, Rocky, & AlmaLinux

Satish Kumar
Updated on 17-Jul-2023 16:30:50

3K+ Views

Introduction LXC, short for Linux Containers, is an operating system-level virtualization method that allows you to run multiple isolated Linux systems (containers) on a single host. It provides a lightweight and efficient alternative to traditional virtualization technologies. In this article, we will guide you through the process of installing LXC on RHEL, Rocky Linux, and AlmaLinux, three popular distributions known for their stability and security. Prerequisites Before proceeding with the installation, ensure that you have the following prerequisites − A supported version of RHEL, Rocky Linux, or AlmaLinux. Sudo or root access to the system. An internet connection. ... Read More

Install Lighttpd with PHP and MariaDB on Rocky Linux

Satish Kumar
Updated on 17-Jul-2023 16:29:33

322 Views

Introduction RockyAlmaLinux is a robust and secure Linux distribution that serves as a perfect replacement for CentOS. If you're looking to set up a web server environment using Lighttpd, PHP, and MariaDB. This article will guide you through the installation process. We'll provide detailed instructions along with examples and the expected output of each command. Prerequisites Before we begin, make sure you have administrative access to your RockyAlmaLinux system and an active internet connection. Step 1: Update the System First, let's update the system's package repositories and upgrade the installed packages to their latest versions. Open a terminal and run ... Read More

Minimize Removal from Front or End to Make Binary String at Equilibrium

Shubham Vora
Updated on 17-Jul-2023 16:26:57

133 Views

In this problem, we will print the minimum number of characters that we need to remove from the start and end to make the count of ‘1’ and ‘0’ the same in the given string. If we find the largest substring with an equal number of ‘1’ and ‘0’, we can get the answer by subtracting the substring length from the given string’s length. We will use the prefix sum technique to find the largest substring having an equal number of ‘1’ and ‘0’. Problem statement − We have given the ‘bin_str’ binary string containing the N characters. We ... Read More

Minimize Max Frequency Difference of 0 & 1 by Dividing Binary String into K Disjoint Subsequences

Shubham Vora
Updated on 17-Jul-2023 16:25:19

125 Views

In this problem, we will divide the given binary string into the K subsequences such that we can minimize the maximum absolute difference of count of ‘1’ and ‘0’ in the given string. The logic to solve the problem is to create a maximum pair of 0 and 1 in subsequences. So, we can get the minimum difference between each subsequence. Problem statement − We have given a bin_str binary string of length N. We have also given the positive integer K. We need to divide the given string into the K disjoint subsequences to minimize the maximum absolute ... Read More

Install Latest SMPlayer in Debian, Ubuntu, Linux Mint, and Fedora

Satish Kumar
Updated on 17-Jul-2023 16:25:09

2K+ Views

Introduction SMPlayer is a popular cross-platform multimedia player that supports various formats and codecs. It provides a user-friendly interface and offers advanced features like playback speed control, subtitle support, and YouTube integration. This article will guide you through the process of installing the latest version of SMPlayer on Debian, Ubuntu, Linux Mint, and Fedora distributions. Installing SMPlayer on Debian-based Systems (Debian, Ubuntu, Linux Mint) Step 1: Open the Terminal To begin, open the terminal on your Debian-based system. You can do this by pressing Ctrl + Alt + T or by searching for "Terminal" in the applications menu. Step 2: ... Read More

Install LAMP Stack with Apache, PHP, MariaDB, and phpMyAdmin in openSUSE

Satish Kumar
Updated on 17-Jul-2023 16:23:33

2K+ Views

Introduction The LAMP stack, which stands for Linux, Apache, MySQL/MariaDB, and PHP, is a powerful combination of open-source software widely used for web development and hosting. In this tutorial, we will guide you through the process of installing and configuring the LAMP stack on openSUSE, a popular Linux distribution. We will cover the installation of Apache, PHP, MariaDB, and PhpMyAdmin, providing detailed examples and command outputs to ensure a smooth installation process. Step 1: Update System Packages Before we begin, it is essential to update the system packages to ensure that we have the latest software versions and security patches. ... Read More

Maximum Product of First and Last Character of String After Rotation

Shubham Vora
Updated on 17-Jul-2023 16:22:35

107 Views

In this problem, we will find the maximum possible product of the first and last digits of the string by rotating the string multiple times. The naïve approach is that find all rotations of the string, take the product of the first and last character, and choose the maximum product as an answer. Another approach is to find the product of every adjacent pair of characters and choose the maximum product. Problem statement − We have given a string num containing the numeric digits. We need to find the maximum product of the first and last character of the given ... Read More

Install Kernel 3.16 Latest Released in Ubuntu and Derivatives

Satish Kumar
Updated on 17-Jul-2023 16:21:56

466 Views

Introduction The Linux kernel is the core component of the operating system that provides essential functionality and manages system resources. Ubuntu, one of the most popular Linux distributions, usually ships with a specific version of the kernel. However, there may be instances where you want to install a different kernel version to access new features or address compatibility issues. In this article, we will guide you through the process of installing Kernel 3.16, the latest released version, in Ubuntu and its derivatives. We will also provide examples and detailed outputs of commands to help you along the way. Step 1: ... Read More

Advertisements