Data structure interview questions (Swift) Part-II
Data structure interview questions (Swift) Part-II
Covered Questions:
1. Given a sorted array nums, remove the
duplicates in-place such that each element appear only once and
return the new length.
2.Design an algorithm to find the
maximum profit .
3. Given an array, rotate the array to the
right by k steps, where k is non-negative.Could you do it
in-place with O(1) extra space?
4. Given an array of
integers, find if the array contains any duplicates.
5.
Given a non-empty array of integers, every element appears twice
except for one. Find that single one.