# Blogs Hub

### by AskGif | Oct 24, 2020 | Category :coding

#### Two Strings - HashMap - Easy - HackerRank

Given two strings, determine if they share a common substring. A substring may be as small as one character. For example, the words "a", "and", "art" share the common substring . The words "be" and "cat" do not share a substring. Function Description Complete the function two

### by AskGif | Oct 18, 2020 | Category :coding

#### Largest Substring Between Two Equal Characters - Array - Easy - LeetCode

Given a string s, return the length of the longest substring between two equal characters, excluding the two characters. If there is no such substring return -1. A substring is a contiguous sequence of characters within a string. &nbsp; Example 1: Input: s = "aa"<br />

### by AskGif | Oct 18, 2020 | Category :coding

#### Mean of Array After Removing Some Elements - Array - Easy - LeetCode

1619. Mean of Array After Removing Some Elements<br />Easy 30 5 Add to List Share<br />Given an integer array arr, return the mean of the remaining integers after removing the smallest 5% and the largest 5% of the elements. Answers within 10-5 of the actual answ

### by AskGif | Oct 18, 2020 | Category :coding

#### Maximum Nesting Depth of the Parentheses - Stack - Easy - LeetCode

A string is a valid parentheses string (denoted VPS) if it meets one of the following: It is an empty string "", or a single character not equal to "(" or ")",<br />It can be written as AB (A concatenated with B), where A and B are VPS's, or<br />It can be written as (A), where A is a VPS.

### by AskGif | Oct 18, 2020 | Category :coding

#### Special Array With X Elements Greater Than or Equal X - Array - Easy - LeetCode

You are given an array nums of non-negative integers. nums is considered special if there exists a number x such that there are exactly x numbers in nums that are greater than or equal to x. Notice that x does not have to be an element in nums. Return x if the array is special, othe

### by AskGif | Oct 18, 2020 | Category :coding

#### Number of Days Between Two Dates - Maths - Easy - LeetCode

Write a program to count the number of days between two dates. The two dates are given as strings, their format is YYYY-MM-DD as shown in the examples. &nbsp; Example 1: Input: date1 = "2019-06-29", date2 = "2019-06-30"<br />Output: 1<br />Example 2: Input: date

### by AskGif | Oct 18, 2020 | Category :coding

#### Reformat Department Table - Sql - Easy - LeetCode

Table: Department +---------------+---------+<br />| Column Name &nbsp; | Type &nbsp; &nbsp;|<br />+---------------+---------+<br />| id &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| int &nbsp; &nbsp; |<br />| revenue &nbsp; &nbsp; &nbsp; | int &nbsp; &nbsp; |<br />| month &nbsp; &nbsp; &nbsp

### by AskGif | Oct 18, 2020 | Category :coding

#### Print in Order - Multi Threading - Easy - LeetCode

Suppose we have a class: public class Foo {<br />&nbsp; public void first() { print("first"); }<br />&nbsp; public void second() { print("second"); }<br />&nbsp; public void third() { print("third"); }<br />}<br />The same instance of Foo will be passed to three different threads. Thread A

### by AskGif | Oct 18, 2020 | Category :coding

#### Shortest Distance to a Character - Array - Easy - LeetCode

Given a string S and a character C, return an array of integers representing the shortest distance from the character C in the string. Example 1: Input: S = "loveleetcode", C = 'e'<br />Output: [3, 2, 1, 0, 1, 0, 0, 1, 2, 2, 1, 0]<br />&nbsp; Note: S string length is i

### by AskGif | Oct 17, 2020 | Category :coding

#### Number of Lines To Write String - String - Easy - LeetCode

We are to write the letters of a given string S, from left to right into lines. Each line has maximum width 100 units, and if writing a letter would cause the width of the line to exceed 100 units, it is written on the next line. We are given an array widths, an array where widths[0] is the width

### by AskGif | Oct 17, 2020 | Category :coding

#### Rotate String - String - Easy - LeetCode

We are given two strings, A and B. A shift on A consists of taking string A and moving the leftmost character to the rightmost position. For example, if A = 'abcde', then it will be 'bcdea' after one shift on A. Return True if and only if A can become B after some number of shifts on A.</p