Company: NxtWave
Difficulty: medium
Minimum Jumps Using Teleportation Problem Description You are given an integer array arr of size n . From an index i , you can move to: index i - 1 , if i - 1 >= 0 . index i + 1 , if i + 1 . index j , if arr[j] is a prime number and arr[i] % arr[j] == 0 . Define the cost of index i as the minimum number of steps needed to reach index i from index 0 . You need to find the cost for each index i ( 0 ). Examples Example 1: Input: n = 4 arr = [1, 2, 4, 6] Output: 0 1 2 2 Example 2: Input: n = 5 arr = [2, 3, 4, 7, 9] Output: 0 1 1 2 2 Explanation: For index 0, it takes 0 steps. For index 1, path: 0 -> 1. For index 2, path: 0 -> 2. For index 3, path: 0 -> 2 -> 3. For index 4, path: 0 -> 1 -> 4. Your Task: Complete the function findMinimumSteps that takes an integer n and a vector of integers arr as input, and returns a vector of integers representing the minimum steps to reach each index from index 0. #include <bits/stdc++.h> using namespace std; class solution { public: vector<int&g