Kartik's posts

Post has attachment

Public

Problem of the day for today is Longest palindromic substring: Given a string, find its longest palindromic substring.. For example, given the string “ababab”, the longest palindromic substring would be “ababa”.

Post has attachment

Public

Another interesting problem that I saw today: Given two sorted arrays, find their combined median (median of the array formed by merging both the arrays). If the number of elements in the combined array is even, then the average of the two middle elements…

Post has attachment

Public

So here’s an interesting problem: Given an NxM integer matrix in which each row is sorted, find the overall median of the matrix assuming N*M is odd. For example,

Post has attachment

Public

I just finished reading this wonderful book: Predictably Irrational by Dan Ariely. It describes how we systematically behave irrationally, hence making it predictable. Although I consider myself a fairly rational person, I must confess I’ve acted rather…

Post has attachment

Public

I started with an interesting hypothesis: “Some days are better than others for investing in Indian mutual funds for buy-and-hold approach“. There’s nothing particular about mutual funds or India; it should apply to most investment vehicles and other…

Post has attachment

Pardon the clickbait title, but there was no easy way to get my friends to learn about 401K, HSA and similar “boring” things. Quite a few of my friends are coming to the US in the next few months and if I can summarize my experiences and my many hours of…

Post has attachment

It’s been nearly two months since my last post. I was seriously low on motivation. I thought I’d try changing the format a little back: add a little more personal narrative and write about things I’m currently reading instead of something I read a while…

Post has attachment

In the previous post, we looked at a heuristic-based general game player, which worked for single player and two player zero-sum games. There are a few problems with this approach though: We need to come up with a good heuristic for the game at hand but…

Post has attachment

In the previous post, we talked about general game playing. Now let’s build a simple general game player, using the algorithms that we’ve already seen (Iterative deepening DFS and Iterative Deepening Alpha Beta Search).

Post has attachment

So far, we’ve talked about designing agents for specific single player and two-player zero-sum games, using heuristics to guide the search, and saw how we can model and tackle uncertainty in move generation. It’s finally time to discuss General Game…

Wait while more posts are being loaded