'Avoid Obstacles' - Codesignal #22 - JAVA Solution

preview_player
Показать описание
Try these popular Algorithm and Java books:
1. Cracking the Coding Interview: 150 Programming Questions and Solutions
2. Introduction to Algorithms
3. Java Pocket Guide: Instant Help for Java Programmers
*As an Amazon Associate I earn from qualifying purchases.
*******************************************************************************************
Like and Subscribe if you enjoy my content!
Or give advice or alternative solutions in the comments below!

You are given an array of integers representing coordinates of obstacles situated on a straight line.

Assume that you are jumping from the point with coordinate 0 to the right. You are allowed only to make jumps of the same length represented by some integer.

Find the minimal length of the jump enough to avoid all the obstacles.

*******************************************************************************************

Follow me on:
Рекомендации по теме
Комментарии
Автор

Like and subscribe if you find this content useful!
Otherwise, provide comments on how I can improve my content.

Support my content by buying these popular Algorithm and Java books:
1. Cracking the Coding Interview: 150 Programming Questions and Solutions
2. Introduction to Algorithms
3. Java Pocket Guide: Instant Help for Java Programmers

*As an Amazon Associate I earn from qualifying purchases

JoshuaCadavez
Автор

You are going through the data given n once so it is O(n)

AlancRodriguez