Skip to content
the poor coder

Home / Topics / #leetcode

#leetcode

131 posts · page 2 of 7
2021

Leetcode - Running Sum of 1d Array Solution

Given an array nums. We define a running sum of an array as runningSum[i] = sum(nums[0]…nums[i]). Return the running sum of nums. Example 1: Example 2: Example 3: Constraints: 1 <= nums.length <= 1000 -10^6 <= nums[i]…

leetcodearray1 min read
2021

Leetcode - Shuffle the Array Solution

Given the array nums consisting of 2n elements in the form [x1,x2,...,xn,y1,y2,...,yn]. Return the array in the form [x1,y1,x2,y2,...,xn,yn]. Example 1: Example 2: Example 3: Constraints: 1 <= n <= 500 nums.length == 2n…

leetcodearray1 min read
2021

Leetcode - Reformat The String Solution

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 and no digit…

leetcodestring2 min read
2021

Leetcode - Maximum 69 Number Solution

Given a positive integer num consisting only of digits 6 and 9. Return the maximum number you can get by changing at most one digit (6 becomes 9, and 9 becomes 6). Example 1: Example 2: Example 3: Constraints: 1 <= num…

leetcodeMath1 min read
ESC