How To Solve Leet Code 27. Remove Element And Exercise Tuple Unpacking And Value Swapping

1. ASSIGNMENT

Given an integer array nums and an integer val, remove all occurrences of val in nums in-place. The relative order of the elements may be changed.
It does not matter what you leave beyond the first k elements.
Input: nums = [3,2,2,3], val = 3
Output: 2, nums = [2,2,_,_]

2. SOLUTION

3. RUBBERDUCK

4. LINKS

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Pavol Kutaj

Pavol Kutaj

Infrastructure Support Engineer/Technical Writer (Snowplow Analytics) with a passion for Python/writing documentation. More about me: https://pavol.kutaj.com