I think the issue is we're supposed to assume that there are no leading
zeroes, so "zig" would be 102 in base 3, or 11.

On Thu, Jun 7, 2018, 09:37 Arijit Basu, <[email protected]> wrote:

> Why is it assumed that the symbols will be in alphabetical/numerical order
> in alien language as they are in human language? e.g. if "a" =1 why can't
> "b" be < 1?
> With this logic we get far lesser time...
> # Input: 11001001
>
> 0 = 1
> 1 = 0
> 1: 0 * 2^0 = 0
> 0: 1 * 2^1 = 2
> 0: 1 * 2^2 = 4
> 1: 0 * 2^3 = 0
> 0: 1 * 2^4 = 16
> 0: 1 * 2^5 = 32
> 1: 0 * 2^6 = 0
> 1: 0 * 2^7 = 0
> Case #1: 54
>
> # Input: cats
> a = 1
> c = 0
> s = 3
> t = 2
> s: 3 * 4^0 = 3
> t: 2 * 4^1 = 8
> a: 1 * 4^2 = 16
> c: 0 * 4^3 = 0
> Case #2: 27
>
> # Input: zig
>
> g = 2
> i = 1
> z = 0
> g: 2 * 3^0 = 2
> i: 1 * 3^1 = 3
> z: 0 * 3^2 = 0
> Case #3: 5
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/4b407f13-7dbf-4639-9d5f-f1449eefecab%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAHaiWHMrrmQkUDoZJ18K6eP%3DzQW6SUwCzvu8mR4XyjYJRSwKNQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to