일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |
Tags
- C#
- Modern javascript #ES6
- 개발자어록
- 주식투자 #캐나다 #캐나다주식 # ETF #BMO #Vanguard #iShares #증권계좌
- Brendan Eich
- html5
- 캐나다이민 #캘거리 #PGWP #유학후이민
- Data Annotation #데이터 라벨링 #크라우드웍스 #crowdworks #AI
- 오락실게임 #추억의 게임 #월강보합 #Pnadora #레트로시티
- 2020년 결산 #주식 #삼성전기 #삼성전자 #다나와
- 아파치 #node.js 연동 #리눅스
- HTML #Meta tag
- 캐나다이민 #유학후이민 #캘거리 #입국심사 #캐나다
- 캐나다이민 #캘거리 #알버타 #BVC
- jiffy #in a jiffy #soon
- 인명사전
- PGWP #캐나다이민 #캘거리
- ping #ping us #ping 의미
- iphone 재활용
- 개발자
- 토론토부동산
- 캐나다부동산
- SVN #CVS #Sourse Safe #형상관리
- 캐나다 동부 #온타리오 #주이동 #이직 #IT취업 #해외취업 #온타리오
- Anders Hejsberg
- 아케이드 #Arcade #
- HTML5 #생산성
- ESL #유스호스텔 #캘거리 #Calgary Library Service #캐나다
- Bragg Creek #캘거리에서 갈만한곳 #피크닉장소 #알버타 #Forget me not
- 1bed
Archives
- Today
- Total
캐나다 전산실 근무자
#1 Remove duplicate number in Array 본문
Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length.
Do not allocate extra space for another array,
you must do this by modifying the input array in-place with O(1) extra memory
Example 1:
Given nums = [1,1,2],
Your function should return length = 2, with the first two elements of nums
being 1 and 2 respectively.
Example 2:
Given nums = [0,0,1,1,1,2,2,3,3,4],
Your function should return length = 5, with the first five elements of nums
being modified to 0, 1, 2, 3, and 4 respectively.
Clarification
Confused why the returned value is an integer but your answer is an array?
Note that the input array is passed in by reference, which means modification to the input array will be known to the caller as well
Comments