This problem is from TopCoder SRM 556 - Div 2 - 250 ptr.Problem Statement |
||||||||||||||||||||||||||||||||||||||||||||||||||||
You just bought a very delicious chocolate bar from a local store.
This chocolate bar consists of N squares, numbered 0 through N-1.
All the squares are arranged in a single row. There is a letter
carved on each square. You are given a string letters. The
i-th character of letters denotes the letter carved on the
i-th square (both indices are 0-based). You want to share this delicious chocolate bar with your best friend. At first, you want to give him the whole bar, but then you remembered that your friend only likes a chocolate bar without repeated letters. Therefore, you want to remove zero or more squares from the beginning of the bar, and then zero or more squares from the end of the bar, in such way that the remaining bar will contain no repeated letters. Return the maximum possible length of the remaining chocolate bar that contains no repeated letters. |
|
Tuesday, October 23, 2012
Chocolate Bar
Monday, October 22, 2012
Great Fairy War
This problem is from TopCoder SRM 557 - Div 2 - 250 ptr.
Problem Statement |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
You are a wizard. You are facing N fairies, numbered 0 through N-1.
Your goal is to defeat all of them. You can only attack one fairy at
a time. Moreover, you must fight the fairies in order: you can only
attack fairy X+1 after you defeat fairy X. On the other hand, all
fairies that have not been defeated yet will attack you all the time. Each fairy has two characteristics: her damage per second (dps) and her amount of hit points. Your damage per second is 1. That is, you are able to reduce an opponent's hit points by 1 each second. In other words, if a fairy has H hit points, it takes you H seconds to defeat her. You are given two vector <int>s, each of length N: dps and hp. For each i, dps[i] is the damage per second of fairy i, and hp[i] is her initial amount of hit points. We assume that your number of hit points is sufficiently large to avoid defeat when fighting the fairies. Compute and return the total number of hit points you'll lose during the fight. In other words, return the total amount of damage the attacking fairies will deal. |
This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2003, TopCoder, Inc. All rights reserved My Solution :-
using System;
|
Tuesday, October 9, 2012
elementFromPoint DOM Method :-
elementFromPoint() is a method on "document"object in HTML.
It returns the HTML element at the given X & Y positions.
For Example :-
1) Position a html element say a textarea at (10,10) as follows :-
<textarea style="position:absolute;left:10px;top:10px">
Following script will show aleart as follows:-
var ele = document.elementFromPoint(11,11);
alert(ele)

It returns the HTML element at the given X & Y positions.
For Example :-
1) Position a html element say a textarea at (10,10) as follows :-
<textarea style="position:absolute;left:10px;top:10px">
Following script will show aleart as follows:-
var ele = document.elementFromPoint(11,11);
alert(ele)
Friday, April 20, 2012
My Journey so far...
Hi friend !!! Thanks for visiting my blog.Let me try to introduce my self to you.
I love being alive and living the life. I believe that we are into this world for having adventure, great experience , lots of fun and great time . And believe that someday we would have to leave every thing behind and move on to God's next play.
Having said that , I would want to live a life of my choice and enjoy what I do, day in and day out. I spend most of my waking hours doing programming and I completely love the experience. I would like to thank my fate to have introduced me to the world of computers very early in my life. I did "Diploma in Computer Science an Technology" from Quli Qutub Shah Govt. Polytechnic after my 10th standard.
During my polytechnic, I learn my first programming language namely "C" and other fundamental subjects like Data structures , Databases , Discrete mathematics. My first favorite programming book is "Let us C" by Yeshwanth Kanetkar. I would like to thank my fate to have introduced me to such a nice book and also being able to provide access to PC to practice programming. In those days I used to go to my Cousin, Shrawan Kumar's, institute every day and competed this book all by myself. I did each and every exercise from this book. Later I did other books of this author like "Pointers in C" and "Test your C skills".
When I was in final year of Polytechnic, I started learning C++. Yet again I came across a nice book in C++ as well.It was "Learning C++ : Hands on Approach" by Eric P. Nagler. Even though I started this book during the final days of my Polytechnic, I could only complete it in my Engineering. I did my Engineering in Information Technology from "Chaitanya Bharathi Institute of Technology". Another book that helped me understand C++ and Object oriented programming concepts better is "C++ FAQs".
During my engineering, we had a very interesting book in our syllabus. It was "Data Structures and Algorithms with Object Oriented Design Patterns in C++" by Bruno R. Preiss. Although I could not do this book completely but what ever part of that book that I did, I enjoyed it completely.
During my engineering, I came across a contest that was sponsored by Microsoft namely "Imagine Cup". To compete in this contest, I started learning C#.net . I attended a 3 day workshop on Dot net by my favorite author Mr Yeshwant kanekar. During this workshop Kanetker told about a nice book on C# named "Inside C#" by Tom Archer. I did this book and also learned Asp.net by listening to web cast called "Asp.net Soups to Nuts" by William Steele . Although I never could do well at that contest but learning Dot net has helped me to earn my bread and butter later in my life.
During my Polytechnic and Engineering , I also worked as a Part Time Home Tutor for School students.
Apart from these , I was fortunate enough to have come across a great online programming contests site called TopCoder , during my engineering . This site has help me realize how bad I was at programming. It helped me get out of the illusion that I was too good at programming already. I still remember the first algorithm contest on this site and how long I took to properly solve the first basic problem in that contest. Later when I went though other contestants submission , I realized how much I was lacking in programming. I practiced regularly on this site for a while but I never could really do well on this site. I loved this site so much that I even spent a few years as freelancer on this site after my engineering.
Later, I joined Neudesic Technologies as a "Custom Application Developer". Initially I worked for about an years or so, on a Maintenance Project for an Insurance Client. Although I was hardly coding on that project , that expedience of bug fixing and maintaining the existing code, has definitely helped me test my "Analysis" skills thoroughly.
Today I work for the same client but on a new development project. This project is on latest Microsoft technologies like MVC , Entity framework etc. But the most interesting part of this project is that, its based on Functional Programming. I never had any experience on Functional Programming prior. This project is definitely helping me understand this new paradigm of programming.
Recently, I have also started going on Trekking. Thanks to my colleague , Manohar Tummala, who introduced me to "Greater Hyderabad Adventure Club". I went on 2 treks so far.
Well, this was, in brief, about my past and current life.
In my next post I will share with you , what I wish I would do with rest of my life.
Thanks once again for visiting this blog !!!
Subscribe to:
Posts (Atom)