Find number of pairs (x, y) in an array such that x^y > y^x

Given two arrays X[] and Y[] of positive integers, find number of pairs such that x^y > y^x where x is an element from X[] and y is an element from Y[].
I need a time-efficient solution, thank you so much.

if you “need” it, seems like is something you should solve by yourself. If it a practice problem, please send the link to the statement

1 Like

you can get the editiorial

1 Like

I could not give out the link because it was a teacher-assigned assignment, you understand for this reason

Hint : Plot the graph of x^{\frac{1}{x}}, should help a lot.