implementation of some coding problems