rewrite the code in spark
Budget: ₹600 – ₹1,500 INR
there is a code in python which is taking longer time and memory to run on databricks, please rewrite the code in spark or if possible to cut short in python, then also fine... need to optimize the code and run with low memory in databricks