5 hours of problem-solving.

Hey all,

I have planned to code for 5 hours straight. I am not going to develop this time. The Plan is to solve medium-hard level SPOJ problems. The initial target was to solve 10 problems, but then I feel I am overestimating myself. Solving 10 problems in 5 hours can be bit far fetched to me. So decided to solve 5 problems in the end.

  1. Aggressive Cows
  2. Horrible Queries
  3. Julka
  4. Party Schedule
  5. Brackets

These are the problems I have picked for solving just by sorting SPOJ problems based on quality.

What am I looking forward to at the end of this code-a-thon?  The aim is to learn and improve problems solving. I don’t get time to learn new concepts, this coding extravaganza is a good opportunity to learn. So you see, the aim is TO LEARN AND IMPROVE.

Coding starts by  5 am and end at 10 am. Starting at this early hour is also a challenge to me. I haven’t done that before too. I will be simultaneously updating here at my blog. Just updates like my insights on the problem and stuff like that.

Good night guys! I am already excited, can’t wait for tomorrow. Wish me luck and Happy coding!

Thanking you,

Aakash Chandrasekaran



  • [5:13 am] Good morning! Without any delay let’s head to solve the first problem. AGGRESSIVE COWS.
  • [5:35 am] Was trying out my luck in binary searching for the largest minimum distance. But I was not able to prove the existence of solutions for the set {1,2,3,…,d-1} if the hypothesis is true for d. You know what I do I need the most to crack now? Coffee.
  • [6: 00 am] Binary searching over d can never lead to a solution. I just convinced myself because of this peculiar example. x = {1,5,7,9,14} has got a solution for d = 4(Cows at positions 5,9,14) but there is no solution for d = 3.  I should find a different approach to crack this problem.
  • [6: 16 am] Let me take a coffee break.
  • [6: 41 am] Let’s come back to aggressive cows later. Let me just solve the HORRIBLE QUERIES. I think it is just plain segment tree with lazy propagation. Complexity : Tree construction – O(n) , Queries = O(C*logn)
  • [9:04 am] Successful submission of HORRIBLE QUERIES :D. Took me a while to grasp the concept of lazy propagation.
  • [9:22 am] Moving ahead to PARTY SCHEDULE. Easy 0-1 Knapsack problem. AC!:D
  • [10:00 am] Time is up! I can solve two problems out of 5. I’ll upsolve them and will make a write up here again. Thank you!

Monthly update

Hey all, It has been a while I shared anything with you guys. So, lots of cool stuff to share.

First off, My work on Neural Networks has finally kicked off. We built a chess engine which could predict the exact move, given the board position. It is a pretty straight forward network(well..actually feed forward :P). It has 64 first layer neurons which take in the inputs for 64 squares on the chess board and 64*63 output neurons for all possible combinations. Training data was 1.8 million games played by chess grandmasters. We wrote the code using Keras, a basic python library, used for learning neural nets. Note, This is just a banal idea which struck me. In real life, this problem is really solved using Reinforcement learning. You see, things have really kicked off. Up next, We are trying to build a poem generator which understands the context of Shakespeare poems and mimics his works. Sounds exciting!!

Secondly, January 13th. It was my girlfriend’s birthday. We had such a memorable night. We drove to Ooty and had her cake(duh!) cut. I really wanted to surprise her and thank god, she really loved all of it.But the most important part of the day was to Families for children. It is a home for underprivileged kids. We were there to make a donation and in turn learned that our approach to life is too parochial. They are happy with things they are provided with. I looked at myself, a twenty-one-year-old adult, who has been given everything which he has asked for. Still finding excuses to stay unhappy. Maybe, I am starting to realize that this self-content attitude comes only to people who have faced enough struggles. Mind you, the kids I am talking about here are merely 15 years old. In fact, most of them are 10. If you take mean and model their ages with gaussian distribution..Okay, forget it.You get the point.

Thirdly, My work with Cisco will be resumed this week, I am planning to complete it ASAP. Most of the work is repetitive. Just plain coding as of now. I haven’t learned anything new with Angular2 lately.

Finally, I am done with my Graduate Aptitude Test for Engineering. Phew. I did well in my terms, certainly, my performance cannot get me to doing masters in IITs or IIScs. I have to start applying to companies which work with products based on Machine Learning. I am pretty confused with my going. Really clueless where my life is going to take me. But hey, I am doing what I want now, Happy about that :). Great going Aakash! I have all the support from my parents and from my girlfriend. Thanks! Amma, Appa and Varshu! Love you all(Happy Valentine’s day to you people).

And today is Valentines Day, Thank you Varsha for gifting me a beautiful greeting card.  Wish things stays like this forever between us.

This is pretty much what has happened during January and mid-Feb 2017. Stay tuned.


To a prosperous 2017..

Sow a thought, reap an action;Sow an action, reap a habit; Sow a habit, reap a character. Sow a character, reap a destiny. This brings out the need for a very concrete understanding of habit.

I see habit as a intersection of knowledge,skill and desire. Knowledge is the theoretical paradigm, the what to do and why. Skill is how to do. And desire is the motivation, the want to do. These three factors are the major ingredients for developing a great habit.

In his book “The 7 habits of highly effective people”,Stephen Covey has brilliantly stated three phases to being a highly proactive person. In his words “Life is,by nature, highly interdependent”.

He emphasised on being a independent person first,which provides a smooth transition to highest state of interdependence. Because you see, interdependence is a choice only independent people can make.

Here we are in the concluding phase, talking about solutions to be more proactive.

Self awareness is the key. Project yourself , and analyze how better you could have reacted to the situations you face. Many situations in life needs introspection so that we don’t repeat that mistakes again. Allot time in your day for self introspection.

Secondly, languages of reactive people absolves them from responsibility. Avoid the usage of languages such as “He makes me mad”,“I can’t handle this environment”,“There is nothing I can do about it”.

Lastly, remember there are two circles : Circle of influence and Circle of concern.Circle of concern revolves around the things over which we have no real control. Circle of influence are things which we can do something about. Find out your circle of concern and react to that situation using your circle of influence.

Personal leadership is not a singular experience.Journey of thousand miles must begin with a single step. New year, new start and way to go. Happy new year  😀

With a bright but slow start..Here we go!

December has already begun and I haven’t done anything worth sharing yet. I know it is late, been busy my exams and project lately. Good. Here we go, This is my first blog post.

“If you aren’t failing you are not innovating enough” said the CEO of SpaceX and Tesla Motors, Elon Musk. Think for yourself, how many opportunities have you missed just afraid to face the failure? Just not wanting to test the waters ? Because that would be total disarray in our very simple life and we don’t want that. Innovating something tangible is only possible if we are ready to come out of our little comfort zone and get ready to fail. But wait, If you think that we are taught our whole life not to fail and suddenly this guy blurts asking us to fail??Boy Oh boy..This book I am going to read now is also meant for you.

“How the billionaire CEO of SpaceX and tesla is shaping our future” authored by Ashlee Vance. My friend gifted me this book.Man! I should thank her for that.

I am already motivated by Musk’s vision and work. Can’t wait to share it with you guys.Stay tuned to read my thoughts on this book. Peace.