Solution by Aaryan Rastogi