Yes, it can be.. i could make it obfuscated and produce a code with lesser
number of characters. :) but i tried to make it understandable.

On Fri, Jun 3, 2011 at 3:21 PM, hary rathor <[email protected]> wrote:

> Akash your code is good but it can be code more short
>
> #include <stdio.h>
>
> int main()
> {
>     unsigned long long int a = 0;
>     char str[]="harish chandra pran";
>     int i, j;
>
>     for ( i = j = 0; str[i]; i++ )
>     {
>          int offset=0;
>      if ( str[i] >= 'a' && str[i] <= 'z' ) offset=26;
>           offset+= str[i] - 'A';
>      if ( (a & (1 << offset)) == 0 )
>      {
>                 a |= (1<< offset);
>                 str[j++] = str[i];
>       }
>
>     }
>
>     str[j] = '\0';
>     printf ("%s\n", str );
>     return 0;
> }
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" 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/algogeeks?hl=en.
>



-- 
-Aakash Johari
(IIIT Allahabad)

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" 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/algogeeks?hl=en.

Reply via email to