Kuro5hin.org: technology and culture, from the trenches
create account | help/FAQ | contact | links | search | IRC | site news
[ Everything | Diaries | Technology | Science | Culture | Politics | Media | News | Internet | Op-Ed | Fiction | Meta | MLP ]
We need your support: buy an ad | premium membership

[P]
Challenges

By Blarney in Blarney's Diary
Thu Jul 31, 2014 at 10:53:57 PM EST
Tags: software problem, ogg frog, super debugging, basic income, MOOC, challenge (all tags)

I have to admit that, for all the discussion of 'challenges' around here, I hadn't really tried any. Now I have. The point of this site CodeEval seems to be that you can complete challenges to win the ability to apply for jobs, and get a good ranking to brag about on your LinkedIn. So now I know what 'challenges' really are - they remind me of the homework that my friends who actually took computer science courses always had to do. I really liked this problem, credited to our overlords at Google.

It took me most of a day to figure it out because I'm not that smart, I scored 97/100 ranking points for speed/memory, but I bet you Kurons could do it much quicker.


I did a few other 'challenges' but I liked this one because there was more to it than looking up an algorithm in Knuth or on Wikipedia and typing it in. It's kind of spooky to think about - the problem involves finding which of 3N-1 expressions satisfy certain criteria, and if you want it to work well for large N you have to do it without actually evaluating each expression - very holistic in feel.

Stuff I learned while doing it:

  1. Seriously FUCK octal it sucks. Why does '011' still evaluate to 9 in so many languages? It's 2014, there is no PDP11, there is no Lisp Machine, and hopefully anyone who even tries to invent a new CPU with an 18-bit word length will be taken outside and shot. Why do we have to preserve some greybeard's stupid in-joke?

    1. I don't know much about regexes, but I ended up writing a regex to remove leading zeros from numbers inside arithmetic expressions.
    2. I better not lose it as I may need it again someday.
    3. It was still less of a pain than rewriting 'eval' would have been.

  2. I shouldn't have skipped number theory class so often. Thankfully I still remember some of it. You can totally do all the math for this problem in Z210.

    1. Once I noticed that I could do the math in Z210, I realized that I should.
    2. Because that is how people who write problems think - they want you to use the 'trick' they taught you, just as I described in my farce The Cookie Problem
    3. I am not a genius but I am pretty good at psyching out test problems.

  3. Yes, there is a way to divide-and-conquer so that you don't have to eval every possible expression.
    1. (Un)surprisingly, doing things in Z210 actually helped.
    2. It's pretty complicated, at least more than, say, qsort.
Sadly, to actually get a high site ranking so IMFs will employ me, I need to do lots of these problems, not just the ones that look fun. Like, I would need to grind through FizzBuzz and stuff to get a high score. Which would show to a prospective employer that I love to do lots of boring repetitive work even without getting paid - so why they'd paid me to do more of it, I haven't a clue.

Given the mercenary Friedmanesque hot flat crowded low-wage global slum ethic behind it, I'm glad I got a little fun out of it. It was fun watching my submission do a 15-digit string just like THAT. Boom. It did take me all day to get there. How about you guys?

Sponsors

Voxel dot net
o Managed Hosting
o VoxCAST Content Delivery
o Raw Infrastructure

Login

Poll
Seeking employment?
o No I am a superdebugger and i will always have a job 0%
o The Creators of Jorbs will bless me if I vote Tea Party and buy guns 50%
o I would eat a turd for $1,000,000. 50%
o Who are we kidding? I'd eat a turd for, like, $100. I've had worse jobs. 0%

Votes: 2
Results | Other Polls

Related Links
o Google
o this problem
o The Cookie Problem
o Blarney's Diary


Display: Sort:
Challenges | 9 comments (9 topical, editorial, 0 hidden)
Challenges (none / 0) (#1)
by Cancer on Thu Jul 31, 2014 at 11:14:54 PM EST

they don't even tell you the programming language to use?

So I could write it in Brainfuck and then upload it and get rated?

It depends on what compiler you use as to what speed it runs and how much memory it uses.

I would assume LLVM would compile C++ code faster than GCC, and that the Intel C++ and Borland C++ compilers would make a program run faster because they optimize it for 64 bit code instructions. Then again Visual C++ isn't even C+11 compliant yet.

Unless it is Python and then Iron Python, CPython, JPython, Python 2.7 or Python 3.X it really matters what version and type of Python that you use.

Is it Javascript that uses Node.js or some other library?

The website doesn't really say what to use and how to write the code. So it is basically useless to me.

Here is a solution in Haskell:
http://www.haskell.org/haskellwiki/Google_Code_Jam/Ugly_Numbers

Here it is in Java:
http://programming-contest-examples.blogspot.com/2012/12/codeeval-ugly-numbers.h tml

Some hints:
http://shashank7s.blogspot.com/2011/04/ugly-number-eg-numer-whose-prime-factor.h tml


talking 'bout challenges (none / 1) (#3)
by LilDebbie on Fri Aug 01, 2014 at 05:17:28 AM EST

so i had this nice, neat little plan to bulldoze four mongorian cities to make way for two properly spaced aztec ones when suddenly my army goes and plows through five mongorian cities like they were cupcakes at your mom's bridge club and now half of 'em are standing around wondering what to do while the fucking settlers catch up.

why yes, i am burning down a city to move it one hex over. two in fact (the other city was moved three hexes southeast). it's not like i wanted ethnic mongorians in my empire anyway.

see, this is why i prefer one city challenge. there you conquer a city, burn it, and move on. no fuss, no muss.

My name is LilDebbie and I have a garden.
- hugin -

Looks like a newer version of Project Euler? (none / 0) (#8)
by channel on Fri Aug 01, 2014 at 11:32:03 PM EST

I'm not quite sure what to think of these type of "competitive coding" things. It does indicate some rough level of competency with data structures and algorithms. Many of the problems are "fun puzzles." But it doesn't relate to issues like maintainability, object orientation, or multi-tiered architecture at all. It seems like something mostly for college students. Also I've noticed that it's usually Russians (along with Finns and Koreans) who win things like this. And yet Russia isn't exactly a hotbed of software innovation, is it? Yes you may have unlocked the "31337 hax0r level 90" badge Igor, but how about making something someone wants to actually pay money for?

ن
Challenges | 9 comments (9 topical, 0 editorial, 0 hidden)
Display: Sort:

kuro5hin.org

[XML]
All trademarks and copyrights on this page are owned by their respective companies. The Rest © 2000 - Present Kuro5hin.org Inc.
See our legalese page for copyright policies. Please also read our Privacy Policy.
Kuro5hin.org is powered by Free Software, including Apache, Perl, and Linux, The Scoop Engine that runs this site is freely available, under the terms of the GPL.
Need some help? Email help@kuro5hin.org.
My heart's the long stairs.

Powered by Scoop create account | help/FAQ | mission | links | search | IRC | YOU choose the stories!