/explore
|
You are here |
theweeklychallenge.org | ||
| | | | |
ahalbert.com
|
|
| | | | | ||
| | | | |
blog.nuculabs.de
Hello, Here are my solutions for the second part of the card: Arrays 101, from LeetCode. Duplicate Zeroes Given an array of integers, remove duplicate zeroes and shift the remaining elements. 1 2 3 4 5 6 7 8 9 10 11 12 13 class Solution: def duplicateZeros(self, arr: List[int]) -> None: """ Do not return anything, modify arr in-place instead. """ index = 0 arr_length = len(arr) while index < arr_length: if arr[index] == 0: arr.insert(index, 0) arr.pop() index += 1 index += 1 Merge Sorted Array Given two sorted arrays, merge them together into nums1. |
|
| | | | | ||
| | | | |
andrewshitov.com
|
|
| | | | | ||
| | | | |
blog.pecar.me
|
|
| | | |||