Align Flexbox Columns Left and Right Using CSS

Riya Kumari
Updated on 23-Jul-2024 16:17:47

21K+ Views

To align flexbox columns left and right using CSS, we can use various flexbox properties. In this article, we will learn and understand three different approaches to exaplain how to align flexbox columns left and right using CSS. We have created two flexible columns using div and flexbox, our task is to align flexible columns to left and right using CSS. Approaches to Align flexbox Columns Left and Right Here is a list of approaches to align flexbox columns left and right using CSS which we will be discussing in this article with stepwise explaination and complete example codes. ... Read More

Count Alternating Subarray

Revathi Satya Kondra
Updated on 23-Jul-2024 11:22:09

309 Views

The Count Alternating Subarrays are used to count the number of subarrays where no two adjacent elements are similar. we can also call these subarrays as alternating subarrays. Problem Statement Before understanding what is "Count Alternating Subarrays" let's see what is a sub-array, and alternating sub-arrays. A subarray is part of an array formed by removing some or no prefixes of the array and removing some or no suffix elements of the given array. While dividing an array into multiple sub-arrays there ... Read More

Find the Maximum Prime Difference

Revathi Satya Kondra
Updated on 23-Jul-2024 11:15:12

215 Views

The Maximum Prime Difference is a problem used to determine the largest difference between indices of two prime numbers in a given array. Problem Statement Here, we have given an array of integers as nums. our task is to find the maximum prime difference between the indices of any two prime numbers in an array. In the given array if we have only one prime number then it returns 0 and if no prime number returns -1. Example Scenario 1 Input: arr = [11, 4, 7, 6, 13] Output: 4 The prime numbers are 11 (index 0), ... Read More

Minimum Operations to Make Median of Array Equal to K

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

317 Views

The problem “Minimum Operations to Make the Median of the Array Equal to K” is used to adjust the elements of an integer array so that its median becomes equal to a given value k. In one operation, you can increase or decrease any element by 1. Problem Statement The goal is to find the minimum number of such operations to make the median of the array equal to K. The median of an array is the middle element when the array is sorted in non-decreasing order. The larger one is considered the median if there are two middle ... Read More

Longest Strictly Increasing or Decreasing Subarray

Revathi Satya Kondra
Updated on 23-Jul-2024 11:12:00

760 Views

The Longest Strictly Increasing or Strictly Decreasing Subarray problem is used to find the maximum length of the contiguous subarray within a given array where the elements are either strictly increasing or strictly decreasing. Problem Statement Given an array of integers nums, return the length n of the longest subarray of n which is either strictly increasing or strictly decreasing. Example Scenario 1 Input: nums = [1, 3, 2, 4, 3, 5, 4, 6] Output: n = 2 The longest strictly increasing subarrays are [1, 3], [2, 4], [3, 5], and [4, 6]. The longest strictly decreasing subarrays ... Read More

Latest Time After Replacing Characters

Revathi Satya Kondra
Updated on 23-Jul-2024 11:07:00

150 Views

The Latest Time You Can Obtain After Replacing Characters sub-task is applied to an input string, in which the string is represented as a 12-hour format time when the maximum number of characters are replaced by '?'. In a 12-hour format time, "HH:MM” where HH is an element from the set {00, 01, …, 10, 11} and MM is also an element from the set {00, 01, …, 59}. The earliest possible time is 00:00, and the latest time is 11:59. Problem Statement In this problem statement, the goal is to replace all "?" characters in the string s ... Read More

Find Score of a String in Python

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

605 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

Advertisements