The aim of this article is to implement a program to minimize a given number by swapping adjacent digits with odd differences. The goal is to determine the lowest amount that can be created from a string of size N indicating an integer using only the characters '1', '2', and '3' by exchanging adjacent characters any number of times. As we all know, a string is a group of characters that ends with the null character "0" in C programming. Characters from the C String are kept in a character array. A C string differs from a character array in ... Read More
The aim of this article is to implement a C++ Program to Find Lexicographically minimum string rotation. Coming on to the definition of string, a string is a group of characters that ends with the null character "0" in C programming. Characters from the C String are kept in a character array. A C string differs from a character array in that it ends with the distinctive character "\0." Finding the rotation of a string that has the lowest lexicographical order among all feasible rotations is known to be the lexicographically minimal string rotation as well as lexicographically smallest circular ... Read More
The aim of this article is to implement a program to check if a given String is K-periodic for all K in range [1, N]. The aim is to determine whether the supplied string is K-periodic provided the string s and the integer K. If a string repeats the sub-string str[0... k-1], it is said to be k-periodic; for example, the string "ababab" is 2 periods long. Print Yes if the supplied string is k-periodic; otherwise, print No. If a character string can be created by concatenating at least one repeats from another string of length k, it is said ... Read More
We can manipulate cursor image for different elements in an HTML document by using the CSS cursor property. Syntax The syntax of CSS cursor property is as follows − Selector { cursor: /*value*/ } The following are the values for CSS cursor property − Sr.No Value & Description 1 aliasIt indicates an alias of something is to be created 2 all-scrollIt indicates that something can be scrolled in any direction 3 autoIt is default and the browser sets a cursor 4 cellIt indicates that a ... Read More
Every element in CSS has a default display value and we can easily change. This is done by explicitly setting the display property value. We will first consider an Unordered list and will set it horizontally with inline. Set the Unordered List With the Default Display The following sets an unordered list. The default display i.e., vertical for a list is displayed here − Machine Learning Python Data Science Python C# Artificial Intelligence Change the Default Display Now, we will change ... Read More
To change the column width based on screen size, use media queries. Media Queries is used when you need to set a style to different devices such as tablet, mobile, desktop, etc. First, set the div − Lorem ipsum dolor, sit amet consectetur adipisicing elit. Quod, maiores! Set the Initial Width To set the width of the above div, use the width property in CSS − .sample { width: 50%; background-color: lightblue; height: 200px; font-size: 18px; } Change the Column Width Now, to change ... Read More
Use the opacity property with the :hover selector to change the opacity on mouse-over. The following is the code to change image opacity on mouse over. Change the image Opacity The following is the image we need to change the opacity on mouse over. We have used the element to set the image − The image class is set with the opacity property value as 1 initially i.e., the actual image − .transparent{ width:270px; height:200px; opacity: 1; transition: 0.3s; } The opacity ... Read More
The cursor can be easily changed in CSS. For that, use the caret-color property. This will allow you to change the color in textarea, input, etc. The following examples illustrate the CSS caret-color property to change the cursor color on a web page. Change the Cursor Color of the Input Element The input is the field where data is entered by the user. To change the cursor color, the is set with the caret-color property − input { font-size: 3em; caret-color: chartreuse; margin: 2%; } Here is ... Read More
The ::marker selector is used to select the marker of a list item in CSS. It updates the marker properties on bullets or numbers i.e., unordered or ordered lists. We will use the ::marker selector with the color property to change the bullet color. Syntax The syntax of CSS ::marker selector is as follows − Selector::marker { attribute: /*value*/; } The following examples illustrate CSS ::marker selector. Create a Colored Vertical Bullet List To add a color to the bullet list, set the ::marker selector. The bullet lists get displayed vertically by default. Here, we ... Read More
The text-align center is generally used to center text of an element. However, we can also center an image using the same text-align property. First, let us see how to center align a text, then we will center an image using the text-align. Additionally, we will also align an image horizontally and vertically as well. Center a Text Using the Text-align Property in CSS Let us first see how to center a heading using the text-align property − h1 { text-align: center; } Example Let us now see the example to center a text on ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP