0% found this document useful (0 votes)
11 views2 pages

Dsa Challenge 3 1 English

The document presents a coding challenge where participants must navigate a broken bridge made of tiles, jumping from one tile to another while adhering to specific jump rules. The initial jump is always 1 unit, and subsequent jumps can vary by -1, 0, or +1 units from the last jump. The goal is to determine if it's possible to reach the last tile, with input constraints and a submission link provided for participants.

Uploaded by

Vrinda Kumawat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views2 pages

Dsa Challenge 3 1 English

The document presents a coding challenge where participants must navigate a broken bridge made of tiles, jumping from one tile to another while adhering to specific jump rules. The initial jump is always 1 unit, and subsequent jumps can vary by -1, 0, or +1 units from the last jump. The goal is to determine if it's possible to reach the last tile, with input constraints and a submission link provided for participants.

Uploaded by

Vrinda Kumawat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

DSA Challenge 3

Problem Statement: You are trying to cross a broken bridge over a lava pond. The bridge is made up of
tiles at specific positions, but not all positions have a tile since some tiles have broken and fallen off over
the ages. To safely cross the bridge, you can jump from one tile to another, but you must avoid falling off
the bridge.

Initially, you are on the first tile, and your first jump will always be exactly 1 unit.

For every subsequent jump, if your last jump was k, the next jump must be one of k − 1, k, or k + 1
units. You can only jump forward and cannot go backward at any point.

Example 1: Input: tiles = [0, 1, 2, 4, 6, 7, 9, 13, 18] Output: True Explanation: You can jump to the last
tile by making the following jumps:

Jump 1 unit to the 2nd tile (1).

Jump 1 unit to the 3rd tile (2).

Jump 2 units to the 4th tile (4).

Jump 2 units to the 5th tile (6).

Jump 3 units to the 7th tile (9).

Jump 4 units to the 8th tile (13).

Jump 5 units to the 9th tile (18).

SUBMISSION LINK (Read This Carefully)

https://forms.gle/bZVpPHz6NLXdjHNi9

Please fill Name, Contact, Output answer, Upload Code file, Upload CV and mark your feedback.

Enter the required details and upload files to finish your Coding Contest within the time limit.

All the Best

Input Format

A list of integers tiles representing the positions of safe tiles in sorted, ascending order

Constraints

2 ≤ tiles.length ≤ 2000

0 ≤ tiles[i] ≤ 2^31 − 1

tiles[0] == 0

tiles is sorted in strictly increasing order.

Output Format

1/2
Return True if you can reach the last tile; otherwise, return False

2/2

You might also like