Maximum Money gfg

https://practice.geeksforgeeks.org/problems/maximum-money2855/1/?category[]=Mathematical&category[]=Mathematical&page=1&query=category[]Mathematicalpage1category[]Mathematical#

This is the problem can anyone help me in correcting my code.


can someone correct it please

@vaibhav277 can you please help me here

hi @akshat42bajpai
No need to run loop in this ques… simply if number of houses are even then ans is (n/2)*k else (n/2 + 1)*k