Company: IBM_15june
Difficulty: medium
Closest Ashram Problem Description In the ancient land of Bharatvarsha, the great warrior Arjun is traveling during his exile. He carries with him a scroll listing the locations of sacred ashrams, measured in yojanas (distance from Hastinapur). The list is sorted in increasing order. Given Arjun's current position, your task is to find the ashram closest to him. If two ashrams are equally distant, Arjun chooses the one closer to Hastinapur (i.e., the smaller value). Input: ashrams : a list of integers of size n (1 ≤ n ≤ 10 5 ) — sorted list of ashram locations (in yojanas) position : an integer (-10 9 ≤ position ≤ 10 9 ) — Arjun's current position Output: Return a single integer — the closest ashram location to the given position. If two ashrams are equally close, return the smaller one. The function signature to complete is: int closest_ashram(vector<int> ashrams, int positions) { // Complete the 'closest_ashram' function below. // The function is e