Create function to convert given string to the output below.
Input
{1069} AND ({1070} OR {1071} OR {1072}) AND {1244} AND ({1245} OR {1339})
Output
{
"AND": [
1069,
{
"OR": [1070, 1071, 1072]
},
1244,
{
"OR": [1245, 1339]
}
]
}
node solution.js