Leet code problem 1641: – Count Sorted Vowel Strings

Given an integer n, return the number of strings of length n that consist only of vowels (a, e, i, o, u) and are lexicographically sorted. A string s is lexicographically sorted if for all valid i, s[i] is the same as or comes before s[i+1] in the alphabet. Example 1: Input: n = 1Output:…

Leet code 1637: – Widest Vertical Area Between Two Points Containing No Points

Given n points on a 2D plane where points[i] = [xi, yi], Return the widest vertical area between two points such that no points are inside the area. A vertical area is an area of fixed-width extending infinitely along the y-axis (i.e., infinite height). The widest vertical area is the one with the maximum width….

Leet code problem 1672: – Richest Customer Wealth

You are given an m x n integer grid accounts where accounts[i][j] is the amount of money the i​​​​​​​​​​​th​​​​ customer has in the j​​​​​​​​​​​th​​​​ bank. Return the wealth that the richest customer has. A customer’s wealth is the amount of money they have in all their bank accounts. The richest customer is the customer that…

Leet code problem 1880: – Check if Word Equals Summation of Two Words

The letter value of a letter is its position in the alphabet starting from 0 (i.e. ‘a’ -> 0, ‘b’ -> 1, ‘c’ -> 2, etc.). The numerical value of some string of lowercase English letters s is the concatenation of the letter values of each letter in s, which is then converted into an…

Leet code problem 1897: – Redistribute Characters to Make All Strings Equal

You are given an array of strings words (0-indexed). In one operation, pick two distinct indices i and j, where words[i] is a non-empty string, and move any character from words[i] to any position in words[j]. Return true if you can make every string in words equal using any number of operations, and false otherwise….

Leet Code problem 1410: – HTML Entity Parser

HTML entity parser is the parser that takes HTML code as input and replace all the entities of the special characters by the characters itself. The special characters and their entities for HTML are: Given the input text string to the HTML parser, you have to implement the entity parser. Return the text after replacing…

How to access the collection elements using the streams?

Streams is introduced in java8 version. It basically helps to write a concise piece of code and it’s functional style of code writing. For the complete piece of code please visit the below mentioned link. The piece of code for stream iteration is mentioned below :- In the above case the “forEach” is a terminal…