daily programmer challenge, find area and perimeter of non uniform shapes