In the past few weeks, I suddenly recalled of an interesting problem I faced during my days in Competitive Programming world. It was called “Make*me-an+[integer!]“, a problem posted in Internet Problem Solving Contest 2015 problemset (link to problem)
The gist of the problem statement is as such:
Output a list of valid ECMA-262 expression of the number 0 to 1000 (inclusive) using only the characters !, [, ], +, –, and/or *, in which the correctness is determined by the value and the type of the expression itself.
For example, !! evaluates to the number 0 (this is a valid output), and +!!+[+] evaluates to string “10” (this is invalid, as the output type need to be evaluated as type number too).
The problem has two subtasks: the easy subtask is to produce the outputs where each expression uses no more than 200 characters; and the hard subtask limits the expression to use no more than 75 characters.
During the competition itself, I solved the easy subtask, but now I was quite interested in solving the hard subtask because … why not? Hahaha. In total, I spents around 2 weeks (including the many off days in between as I wasn’t in the mood for coding).
So, let’s get into the problem.
Continue reading “Learn to Count in JS!”
Week 6 felt really short. It was Chinese New Year week of which I went back since the Tuesday night and only felt school work at Monday till Tuesday afternoon. Continue reading “Week 6, Semester 4: Chinese New Year!”
10 February 2015
Phew, at last I got decent time for writing. The weekend has been spent fully on other issues (like very serious issue on copyright violation by Indonesian Wikipedia where I run my bot for more than 24 hours and generated like 47k edits, that’s more than twice my edit count since my registration in 2009 😛 ) The week has been well spent for lots of stuffs like NTUBS CNS Recruitment, experimenting with Gerrit, starting a new side-project, and group project meetings. Continue reading “Week 4, Semester 4: Busy weekend”
30 December 2014
Finally, the final post in 2014. This post is to review what’s going on during the whole year. Continue reading “2014 in review”
5 November 2014
I’ve been very busy in the recent days in catching up with lessons since last week on Friday, me and my friends went to compete in ACM ICPC Regional KL, leaving tons of assignments behind 😛
So, I’ve found a free time and this is it. Continue reading “Week 11, Semester 3 + ACM ICPC Asia Kuala Lumpur Regional Contest 2014”
20 April 2014
This week was the last lecturing week before exam. I’ve started revising and I will start my exam on 25 April and end on 8 May. Continue reading “Week 13, Semester 2”
23 February 2014
This week is just another normal week, but I’m quite relax as there were very minimum number of quizzes. Continue reading “Week 6, Semester 2”