Ad
  • Default User Avatar

    yah, gotta say this seemed terribly easy for a 4 kyu kata. I hit submit expecting to wait 15 seconds and get a "timeout" error from test cases with absurdly massive values of k and n, but nope, straight-forward, naive implementation worked. :shrug:

    I was solving in go, for the record.

  • Default User Avatar

    Thank you for the compliments.

    Most programming competitions are aimed for high school coders, so it will be hard for college students to start; however, there are still many local competitions that occur everywhere, so that is a good place to start. Ironically, my coding teacher told me to start practicing for competitions by using this site beacuse the questions here come out of competitions and job interviews sometimes.

    I admire students with jobs. Having many friends in the college I will go to, I understand the time pressure. I wish you good luck with your programming!

  • Default User Avatar

    I thought the same thing, but it ran in about the same time as the conventional code.

    The reason for this is than my code has two loops, but each loop only has one check, making it O(2N) like you said. However, the conventional code has one loop, but two checks in it. This makes it O(2N) as well. This code did run slightly faster, but that probably has to do with server load - not efficiency.

    To answer your question about the competitions, my team likes to have clean and clever code that looks better for judges. This takes more memory, but memory isn't much of a factor in the code's readability and use of convention. Run time is a factor though.

    Thank you for your feedback! :)