Quantcast
Channel: Leetcode: Steps to Make Array Non-decreasing - Code Review Stack Exchange
Browsing all 3 articles
Browse latest View live

Answer by J_H for Leetcode: Steps to Make Array Non-decreasing

integer vs. float || nums.length > Math.pow(10, 5)) {Clearly an exact representation of 1e5 will easily fit within a double.It's not obvious to me that pow is guaranteed to return 1e5.An...

View Article



Leetcode: Steps to Make Array Non-decreasing

I was trying out leetcode's Steps to Make Array Non-decreasingAs per the challenge's description:You are given a 0-indexed integer array nums. In one step, remove allelements nums[i] where nums[i - 1]...

View Article

Image may be NSFW.
Clik here to view.

Answer by ccot for Leetcode: Steps to Make Array Non-decreasing

UpdateAfter several trials and coming up with multiple approaches, this exercise is not solvable in O(1) memory space/ with O(n) time complexity - to the best of my knowledge and trials past couple of...

View Article
Browsing all 3 articles
Browse latest View live




Latest Images