Decrypt String from Alphabet to Integer Mapping Leetcode Solution

Problem Statement In this problem, we are given a string containing digits (0-9) and ‘#’. We have to convert this string to a string of lowercase english letters by using the following mapping. Example s = “10#11#12” “jkab” Explanation: “10#” -> “j” , “11#” -> “k” , “1” -> “a” …

Read moreDecrypt String from Alphabet to Integer Mapping Leetcode Solution

Maximum Subarray Leetcode Solution

Problem Statement Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. Example nums = [-2,1,-3,4,-1,2,1,-5,4] 6 Explanation: [4,-1,2,1] has the largest sum = 6. nums = [-1] -1 Approach 1 (Divide and Conquer) In this approach …

Read moreMaximum Subarray Leetcode Solution

Sort Array by Increasing Frequency Leetcode Solution

Problem Statement Given an array of integers nums, sort the array in increasing order based on the frequency of the values. If multiple values have the same frequency, sort them in decreasing order. Example nums = [1,1,2,2,2,3] [3,1,1,2,2,2] Explanation: ‘3’ has a frequency of 1, ‘1’ has a frequency of …

Read moreSort Array by Increasing Frequency Leetcode Solution