https://leetcode.com/problems/minimum-distance-to-the-target-element/



Runtime: 74 ms, faster than 83.33% of TypeScript online submissions for Minimum Distance to the Target Element.

Memory Usage: 45.2 MB, less than 58.33% of TypeScript online submissions for Minimum Distance to the Target Element.



```typescript
function getMinDistance(nums: number[], target: number, start: number): number {
    //8:44
    let minimized = 99999999
    for (const [index, num] of nums.entries()) {
        if (num === target) {
            const value = Math.abs(index - start)
            if (value < minimized) {
                minimized = value
            }
        }
    }
    return minimized
    //8:46
};
```
