@Gowtham_Akula,
As per best practice idx should not be used in selector as it’s not reliable. Stick to option B