# Month: April 2020

#### LeetCode – Strings – Maximum Score After Splitting a String

Given a string s of zeros and ones, return the maximum score after splitting the string into two non-empty substrings (i.e. left substring and right substring). The score after splitting a string is the number of zeros in the left substring plus the number of ones in…

#### LeetCode – Strings – Reformat The String

Given alphanumeric string s. (Alphanumeric string is a string consisting of lowercase English letters and digits). You have to find a permutation of the string where no letter is followed by another letter…

#### LeetCode – Arrays – Duplicate Zeros

Given a fixed length array arr of integers, duplicate each occurrence of zero, shifting the remaining elements to the right. Note that elements beyond the length of the original array are not written.…

#### LeetCode – Arrays – Rank Transform of an Array

Given an array of integers arr, replace each element with its rank. The rank represents how large the element is. The rank has the following rules: Example 1: Input: arr =…

#### LeetCode – Arrays – Element Appearing More Than 25% In Sorted Array

Given an integer array sorted in non-decreasing order, there is exactly one integer in the array that occurs more than 25% of the time. Return that integer. Example 1: Input: arr = [1,2,2,6,6,6,6,7,10]…

#### LeetCode – Arrays – Shift 2D Grid

Given a 2D grid of size m x n and an integer k. You need to shift the grid k times. In one shift operation: Return the 2D grid after applying shift operation k times. Example 1: Input: grid = [[1,2,3],[4,5,6],[7,8,9]], k…

#### LeetCode – Arrays – Count Largest Group

Given an integer n. Each number from 1 to n is grouped according to the sum of its digits.  Return how many groups have the largest size. Example 1: Input: n = 13 Output: 4 Explanation: There…

#### LeetCode – Arrays – Minimum Value to Get Positive Step by Step Sum

Given an array of integers nums, you start with an initial positive value startValue. In each iteration, you calculate the step by step sum of startValue plus elements in nums (from left to right). Return the minimum positive value of startValue such that…

#### LeetCode – Arrays – Play with Chips

There are some chips, and the i-th chip is at position chips[i]. You can perform any of the two following types of moves any number of times (possibly zero) on any chip: There can be…

#### LeetCode – Arrays – Minimum Absolute Difference

Given an array of distinct integers arr, find all pairs of elements with the minimum absolute difference of any two elements.  Return a list of pairs in ascending order(with respect to pairs), each pair [a, b] follows…
{"ft_lang_label":"__label__en","ft_lang_prob":0.64940995,"math_prob":0.9410198,"size":328,"snap":"2023-14-2023-23","text_gpt3_token_len":68,"char_repetition_ratio":0.18518518,"word_repetition_ratio":0.0,"special_character_ratio":0.20121951,"punctuation_ratio":0.06557377,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.97854686,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-06-06T11:56:35Z\",\"WARC-Record-ID\":\"<urn:uuid:6372e0ae-009b-4367-b017-91ba044f1f05>\",\"Content-Length\":\"79442\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:6d69fb51-fb3d-4a17-999f-796ea86799d4>\",\"WARC-Concurrent-To\":\"<urn:uuid:1d38fbad-eee7-45a4-ada3-c0d0cfdc6f86>\",\"WARC-IP-Address\":\"160.153.0.193\",\"WARC-Target-URI\":\"https://devopspal.com/2020/04/\",\"WARC-Payload-Digest\":\"sha1:SP6TUX6PVV5AY7ZHPCUGHRIHYNVJUKYD\",\"WARC-Block-Digest\":\"sha1:C64UOILUGBOJDMOTUOUJK7QQDK7WZ4PT\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-23/CC-MAIN-2023-23_segments_1685224652569.73_warc_CC-MAIN-20230606114156-20230606144156-00070.warc.gz\"}"}