Dsa Challenge 3 1 English
Dsa Challenge 3 1 English
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:
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.
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
Output Format
1/2
Return True if you can reach the last tile; otherwise, return False
2/2