# Blogs Hub

### by Sumit Chourasia | Dec 02, 2020 | Category :coding

#### Richest Customer Wealth - String - Easy - LeetCode

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

### by Sumit Chourasia | Dec 02, 2020 | Category :coding

#### Maximum Repeating Substring - String - Easy - LeetCode

For a string sequence, a string word is k-repeating if word concatenated k times is a substring of sequence. The word's maximum k-repeating value is the highest value k where word is k-repeating in sequence. If word is not a substring of sequence, word's maximum k-repeating value is 0. Giv

### by Sumit Chourasia | Nov 24, 2020 | Category :coding

#### Check If Two String Arrays are Equivalent - String - Easy - LeetCode

Given two string arrays word1 and word2, return true if the two arrays represent the same string, and false otherwise. A string is represented by an array if the array elements concatenated in order forms the string. &nbsp; Example 1: Input: word1 = ["ab", "c"], word2

### by Sumit Chourasia | Nov 21, 2020 | Category :coding

#### Valid Triangle Number - Array - Medium - LeetCode

Given an array consists of non-negative integers, your task is to count the number of triplets chosen from the array that can make triangles if we take them as side lengths of a triangle.<br />Example 1:<br />Input: [2,2,3,4]<br />Output: 3<br />Explanation:<br />Valid combinations are:&nbsp;<br

### by Sumit Chourasia | Nov 21, 2020 | Category :coding

#### Shortest Unsorted Continuous Subarray - Array - Medium - LeetCode

Given an integer array nums, you need to find one continuous subarray that if you only sort this subarray in ascending order, then the whole array will be sorted in ascending order. Return the shortest such subarray and output its length. &nbsp; Example 1: Input: nums

### by Sumit Chourasia | Nov 21, 2020 | Category :coding

#### Array Nesting - Array - Medium - LeetCode

A zero-indexed array A of length N contains all integers from 0 to N-1. Find and return the longest length of set S, where S[i] = {A[i], A[A[i]], A[A[A[i]]], ... } subjected to the rule below. Suppose the first element in S starts with the selection of element A[i] of index = i, the next e

### by Sumit Chourasia | Nov 21, 2020 | Category :coding

#### Subarray Sum Equals K - Array - Medium - LeetCode

Given an array of integers nums and an integer k, return the total number of continuous subarrays whose sum equals to k. &nbsp; Example 1: Input: nums = [1,1,1], k = 2<br />Output: 2<br />Example 2: Input: nums = [1,2,3], k = 3<br />Output: 2<br />&nbsp; Constra

### by Sumit Chourasia | Nov 20, 2020 | Category :coding

#### K-diff Pairs in an Array - Array - Medium - LeetCode

Given an array of integers nums and an integer k, return the number of unique k-diff pairs in the array. A k-diff pair is an integer pair (nums[i], nums[j]), where the following are true: 0 &lt;= i, j &lt; nums.length<br />i != j<br />|nums[i] - nums[j]| == k<br />Notice that |val|

### by Sumit Chourasia | Nov 20, 2020 | Category :coding

#### Teemo Attacking - Array - Medium - LeetCode

In LOL world, there is a hero called Teemo and his attacking can make his enemy Ashe be in poisoned condition. Now, given the Teemo's attacking ascending time series towards Ashe and the poisoning time duration per Teemo's attacking, you need to output the total time that Ashe is in poisoned cond

### by Sumit Chourasia | Nov 19, 2020 | Category :coding

#### Circular Array Loop - Array - Medium - LeetCode

You are given a circular array nums of positive and negative integers. If a number k at an index is positive, then move forward k steps. Conversely, if it's negative (-k), move backward k steps. Since the array is circular, you may assume that the last element's next element is the first element,

### by Sumit Chourasia | Nov 19, 2020 | Category :coding

#### Find All Duplicates in an Array - Array - Medium - LeetCode

Given an array of integers, 1 &le; a[i] &le; n (n = size of array), some elements appear twice and others appear once. Find all the elements that appear twice in this array. Could you do it without extra space and in O(n) runtime? Example:<br />Input:<br />[4,3,2,7,8,2,3,1]</