Find Score of a String in Python

Revathi Satya Kondra
Updated on 23-Jul-2024 11:06:32

532 Views

The Score of a String is a concept which is used to calculate the score based on the sum of the absolute differences between the ASCII values of adjacent characters in the string. Problem Statement Given a string s, calculate the score of the string. The score is defined as the sum of the absolute differences between the ASCII values of adjacent characters. Example Scenario 1 Input: s="abc" Output: 2 The ASCII values of the characters in s are 'a' = 97, 'b' = 98, 'c' = 99. So, the score of s = |97-98|+|98-99|= 1+1 ... Read More

HTML Tables with Fixed Header on Scroll in CSS

AmitDiwan
Updated on 23-Jul-2024 09:25:20

25K+ Views

We can create HTML tables with fixed header on scroll using CSS. It helps to increase readability as user doesn't have to scroll everytime to check the table header. In this article, we will learn and understand two different approaches for HTML tables with fixed header on scroll in CSS. We have a table inside a div element with class name as container. Our task is to fix HTML table header on scroll using CSS. Approaches for HTML Tables with Fixed Header on Scroll Here is a list of approaches for HTML tables with fixed header on scroll in CSS ... Read More

Set Float Input Type in HTML5

Timpol
Updated on 22-Jul-2024 16:15:39

3K+ Views

Sometimes, we must provide an input field that accepts float value. There are two ways to do so, suppose you design a form where you have asked for the CGPA of any student to fill the form or a form where you have asked for the CTC these numbers could be a floating number. What is the float input type? A number with a decimal place is referred to as a float or floating-point number. Floats are used when we need to increase accuracy. Approachs to set the float input Type That being said, HTML5 does not support the ... Read More

Set the Limit of Text Length to N Lines Using CSS

Shubham Vora
Updated on 22-Jul-2024 13:06:47

13K+ Views

To set the limit of text length to n lines, it can help in more organized presentation of text and better readability. This process is also known as truncating. In this article we will be understanding diifferent approaches to truncate the text. In this article, we are having a div element with some text content in it. Our task is to limit the text length to N lines using CSS. Approaches to Set the Limit of Text Length to N Lines Here is a list of approaches of how to Set Color of Progress Bar using HTML and CSS with ... Read More

Difference Between Vector and List

Shirjeel Yunus
Updated on 22-Jul-2024 11:34:04

1K+ Views

Vector and List are present in many programming languages like C++, R, etc. and they are used to add and remove elements. These elements can be accessed randomly in a vector but not in a list. In this article, we will discuss the difference between vector and list in C++. What is Vector in C++? A vector is a container which works as a dynamic array. It can be used to store elements whose datatype is same. Vectors also have a characteristic of growing or shrinking at runtime. Vectors belong to the Standard Template Library (STL) and header file ... Read More

Difference Between Parallel and Sequential Streams in Java

Shirjeel Yunus
Updated on 22-Jul-2024 11:28:53

1K+ Views

Stream was introduced in Java 8 and it was included as java.util.stream package. It is a sequence of objects which acts as an array or a collection. Different types of methods are supported by stream. Besides this, stream also supports different kinds of aggregate operations which include − Filter Map Reduce Limit Match Find The source is not affected when any of these operations are performed on a stream. Instead of this, a new stream is created to apply these operations. There are two types of streams which are sequential and parallel. In this article, we will discuss ... Read More

Difference Between Controller and RestController Annotation in Spring

Shirjeel Yunus
Updated on 22-Jul-2024 10:55:48

2K+ Views

Spring Annotations can be referred to as metadata which provides information related to a program. Supplemental information of a program can be derived from annotations. The annotation will not affect the program nor the action of the compiled program be changed. Spring annotations are of two types which are @Controller and @RestController. In this article, we will see the difference between @Controller and @RestController. What is @Control Annotation? Spring @Controller Annotation is responsible for informing that a particular class can behave in the form of a controller. The @Controller annotation and the annotated handler methods are used in combination with ... Read More

Change the Color of Radio Button Using CSS

Shabaz Alam
Updated on 19-Jul-2024 15:27:07

28K+ Views

To change the color of the radio button using CSS, is a simple process that can be achieved using various approaches. In this article, we will learn and understand two different approach for changing the color of the radio button using CSS. Radio buttons allows to select one option out of many available options. In this article, we are having a radio button and our task is to change the color of radio button using CSS. Approaches to Change the Color of the Radio Button Here is a list of approaches to change the color of the radio button using ... Read More

Create a Signup Form with HTML and CSS

AmitDiwan
Updated on 19-Jul-2024 13:26:37

17K+ Views

In this article, we will be understanding How to create a signup form with HTML and CSS. A sign-up form allows any new user visiting the website to register. It includes adding an email-id, password, repeat password, and clicking on the Sign-Up button to register. To allow the browser to save the password, click the Remember Me. You can also provide a Terms & Policies link so the users can first read the registration terms. Let us see how to create a signup form with HTML and CSS. Steps to Create Sign Up Form We are following 2 steps to ... Read More

Difference Between List, Set, and Map in Java

Shirjeel Yunus
Updated on 18-Jul-2024 15:14:27

7K+ Views

Java has a java.util package that consists of a Collection interface. This interface has many sub-interfaces and classes like List, Set, and Map. In this article, we will learn the difference between List, Set, and Map. What is List Interface? Java has a Collection interface and List is the sub-interface of Collection. This interface consists of methods like insert, update, delete, and search. Developers are also allowed to insert null elements. List Interface Example The List interface can be found in the java.util package. An example of a List is given below − import java.util.*; public class ListExample { ... Read More

Advertisements