diff --git a/LeetcodeProblems/Algorithms/Count of Smaller Numbers After Self b/LeetcodeProblems/Algorithms/Count of Smaller Numbers After Self index e3a09d1..9563277 100644 --- a/LeetcodeProblems/Algorithms/Count of Smaller Numbers After Self +++ b/LeetcodeProblems/Algorithms/Count of Smaller Numbers After Self @@ -18,12 +18,16 @@ Output: [0,0] -def countSmaller(nums): - result = [] - for i in range(len(nums)): - count = 0 - for j in range(i + 1, len(nums)): - if nums[j] < nums[i]: - count += 1 - result.append(count) - return result +function countSmaller(nums) { + const result = []; + for (let i = 0; i < nums.length; i++) { + let count = 0; + for (let j = i + 1; j < nums.length; j++) { + if (nums[j] < nums[i]) { + count += 1; + } + } + result.push(count); + } + return result; +}
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: