Once you push them to the right, you transpose / rotate it by 90 degrees
(you don't have to do that for the purpose of the solution), but in order
for you to answer that question by yourself, just do that and see :)

On Sat, May 22, 2010 at 10:00, srinivas upadhya
<[email protected]>wrote:

> i don't know if its allowed to discuss this here so soon..
> but the competition is over and the solutions are already put up so i
> take the liberty to discuss it..
> - Start -
>  .......
>  .......
> .......
> ...R...
> ...RB.. <=
> ..BRB..
> .RBBR..
>
> - Gravity -
> .......
> .......
>  .......
> R......
> BB..... <=
> BRR....
> RBBR...
>
> the analysis says..
> just push everything to the right..with the following code..
> for (int row = 1; row < n; ++row) {
>      int x = n-1;
>      for (int col = n-1; col >= 0; col--)
>        if (piece[row][col] != '.') {
>          piece[row][x] = piece[row][col]; x--;
>        }
>      while(x>=0) {piece[row][x]='.'; x--;}
>    }
>
> well thats what i thought of initially..but then how did the letters
> change in the marked columns! i mean how did RB become BB while BRB
> become BRR!
>
> some 2010 people have solved it! so i guess im missing
> something..would like to know what..
> thanks in advance..
>
> --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-code%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>
>


-- 

Thanks & Regards,
Dhruva Sagar.

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.

Reply via email to