HackerEarth String weight Solved