Why we have return the value as -1 after the loop?
@vanshikasharma1645, It indicates that the required key was not found.