Link: https://leetcode.com/problems/non-decreasing-array/
Continue readingAuthor: Sebastian Vîrlan
LeetCode – Beautiful Array
Link: https://leetcode.com/problems/beautiful-array/
Continue readingLeetCode – Array of Doubled Pairs
Link: https://leetcode.com/problems/array-of-doubled-pairs/
Continue readingLeetCode – Longest Mountain in Array
Link: https://leetcode.com/problems/longest-mountain-in-array/ Solution 1: find peak go left to find the increasing start index go right to find
Continue readingLeetCode – Valid Mountain Array
Link: https://leetcode.com/problems/valid-mountain-array/ Solution 1 – Walking from left and right: walking the mountain from left – increment l
Continue readingLeetCode – Rotate Array
Solution 1 (in place):
Continue readingLeetCode – Sort Array By Parity
Link: https://leetcode.com/problems/sort-array-by-parity/ Solution: The evenIndex variable literally keeps track of where the next even number should be. We
Continue readingLeetCode – Shuffle the Array
Link: https://leetcode.com/problems/shuffle-the-array/ Solution: iterate n times (half size of the array) each iteration will add a pair (x1,
Continue reading