728x90
반응형
squares of a sorted array
-
[Leet Code] Two Pointers (투포인터): 977.Squares of a sorted array - EasyCS기초/Coding Test 2022. 11. 13. 19:20
* Two Pointers 알고리즘 설명 문제 / 코드 Description Return an array, sorted in non-decreasing order, of the squares of each value in the input array. How to solve The point is if there was/were neg numbers, the order of values can be changed from the input array after squaring. So we can't just return the original order of the input array but we need to compare the square of each value and change the val..