Category Archives for "TopCoder"

TopCoder – ListeningSongs

Problem Name Competition Difficulty ListeningSongs SRM 679 Easy Solution Full source code is available here. I found this problem a bit more involved in terms of coding for an easy problem. Lucky with LINQ the code is relatively compact but I think people competing with other languages could have find it a bit long. From the […]

Continue reading

TopCoder – AttackOfTheClones

Problem Name Competition Difficulty AttackOfTheClones SRM 678 Medium Analysis Full source code is available here. This problem is quite interesting! It is immediately clear that the number of possible combinations is so high that the solution must use a sort of greedy algorithm. A brute force approach to identify all possible sequences is impractical. However, if given a […]

Continue reading

TopCoder – ThePhantomMenace

Problem Name Competition Difficulty ThePhantomMenace SRM 678 Easy Solution Full source code is available here. To solve the problem, we need to calculate the safety level for each door and then return the maximum. To calculate the safety level of a door, we need to get the positive distance between each drone and the door and take the […]

Continue reading

TopCoder – BearPermutations2

Problem Name Competition Difficulty BearPermutations2 SRM 673 Hard Analysis Full source code is available here. This is the kind of problem that is beyond my current level of problem solving skills. After reading the problem statement you start thinking about possible approaches that all turns out to be impractical or unclear and the only thing you say […]

Continue reading

TopCoder – Bear Slowly Sorts

Problem Name Competition Difficulty Bear Slowly Sorts SRM 673 Medium Analysis Full source code is available here. We have an array of numbers. At any given time, there are two possible moves: Sort the first N – 1 numbers Sort the last N – 1 numbers We are interested to know the minimum number of moves […]

Continue reading

TopCoder – BearSong Problem

Problem Name Competition Difficulty BearSong SRM 673 Easy Solution Full source code is available here. The immediate solution that comes to mind is to iterate the notes array, count how many times each note occurs and return the number of notes that occurs only once. You can do this with LINQ very easily. It’s easy to […]

Continue reading

Top Coder Problem – WolfDelaymaster

During my last SRM 593 on TopCoder I found the medium problem quite interesting and I was happy that I have been able to solve it relatively quickly using the technique of Dynamic Programming. Solving this problem taught me two important lessons: The power of Dynamic Programming The trap of over-optimization The interesting thing is […]

Continue reading
>