Typescript Get Last Index Of Array Python Example Problem