# Code 4 Bill

This is the Code4Bill blog. If you're looking for the contest site, head on over to http://www.code4bill.com
• #### Fibonacci system

We typically learn binary system, hex system in our courses. Most of them are predictable in their position values or they are linear. This system is not linear as its dependant on Fibonacci series. 3 is the first duplicate (ignoring 1 as we started...
• #### Two digit numbers

I always wondered how to place digits 0 to 9 in a matrix which contains all the digits from 00 to 99 and what is the minimum matrix size that is needed.In this question we are trying to enumerate the number of numbers we can produce. Lot of people are...
• #### Counting bits - continued

Lot of people sent code with counting bits method. Some people also sent the permutations sequence and expressions to say how many numbers exist before N that have same 1's in binary form. Counting 1's in a number is better than O(N) algorithm where...
• #### Number of 1s problem

Previously I asked a question regarding the distribution of how many swaps are needed to move array elements. Here we are trying to count the number of 1's. Counting number of 1's vs the distribution table (All numbers which have 2 1's and how many times...
• #### December 13th brain teaser

[ Go to http://www.microsoft.com/india/code4bill/SampleQuestion.aspx to see the question - Sriram] Trying to move to coding related questions from number sequences. The reason I chose 32 is to make sure recursion doesn’t terminate quickly. Not trying...
• #### The power of 2! (Dec 12th Brain teaser)

[ To see the question referred to in this blog post, check out www.code4bill.com (the Dec 12th brain teaser) - Sriram Krishnan] The previous two questions were easy to crack by writing simple code. So I thought we could use some machine power to actually...
• #### Oh My God!

I'm sure several people had had this experience. You spend a lazy Saturday at home whiling away your time and sleeping. Sunday morning, you come to work, open your email and you go 'Oh My God!' at something you see in your email and you curse yourself...