Generate an array and print out the Nth value of the array
Anonymous User
280

Given an sorted array (no duplicated values),
if k is in it, then 2k+1 and 3k+1 also in it.
The first element is 1

The array looks like: [1, 3, 4, 7, 9, 10, ...]

Print out the Nth value of the array, e.g. at index 10, the value is 22

Hint: use two pointers

Colud anyone help with this question? Thanks.

Comments (1)