added solution in python
added c solution