Ad
  • Custom User Avatar

    Python noob here, I gotta say Python one-liners like list comprehension are starting to look pretty understandable (at this level of complexity, at least...)
    But cramming logic that repeats on each 'x' doesn't look good for Big O, for sure.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    mii - map[int][int]
    maxK - max key
    maxV - max value :)

  • Custom User Avatar

    Though clear, I don't see an explicit statement of what a peak or a local maximum is.
    Otherwise a nice one, find this kinda easier than 5ers or even 6ers I did previously.

  • Custom User Avatar

    Depreciation is not something that suddenly occurs at a single moment. It is a process that takes place over a period of time.
    If depreciation rate increases in the end of a month (say Feb 28 23:59), that normally means it will only start excercising its depreciating effect from March 01, 0:00 on.
    So, according to description, if rate changes end of second month, then first 2 months must be discounted/depreciated at a rate of 1.5.
    A theoretical case can be made that the amortisation rate is not from regular wear, but from somebody with a crowbar smashing the car in very regular intervals just before end of month. But no talk of such thing in the description.
    jimmy.clayton is correct in their 1. remark.

  • Custom User Avatar

    Totally looks like the best solution, totally logical.
    What I still don't understand is what abreviations mii, maxV, maxK stand for. Probably makes sense in a language other than English.