Given a directed graph with N nodes and M edges. Each node is associated with lowercase english alphabet. Beauty of a path is defined as the number of most frequently occurring alphabet. Find the most beautiful path and return the maximum beauty value it has.
1 < N,M < 300000
**FUNCTION DESCRIPTION: **
Complete the function beauty in code. Function must Return an integer, the beauty of most beautiful path. If the value is very large return -1.
Function beauty has the following parameter(s):
n: integer, number of nodes
m: integer, number of directed edges
S: string of length n where ith alphabet denotes the alphabets associated with ith node
X: list of length m
Y: list of length m
Source: Windows Questions C++