Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
33 views

Code Wars 2007 - Programming Output Testers

The document contains examples of test cases and outputs for various programming problems: 1. HE_Man question - Returns sets of numbers based on input strings and numbers. 2. return porky; - Returns numbers that are divisible by 5 and 6 based on input numbers. 3. No time waste Problem - Returns the number of lattice points on a circle based on the radius. 4. Guitar serial numbers - Returns sets of strings sorted alphabetically. 5. Rot13 Problem - Returns encrypted/decrypted strings using the Rot13 cipher.

Uploaded by

vishal_tripathi
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views

Code Wars 2007 - Programming Output Testers

The document contains examples of test cases and outputs for various programming problems: 1. HE_Man question - Returns sets of numbers based on input strings and numbers. 2. return porky; - Returns numbers that are divisible by 5 and 6 based on input numbers. 3. No time waste Problem - Returns the number of lattice points on a circle based on the radius. 4. Guitar serial numbers - Returns sets of strings sorted alphabetically. 5. Rot13 Problem - Returns encrypted/decrypted strings using the Rot13 cipher.

Uploaded by

vishal_tripathi
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

OUTPUT TESTERS

[1] HE_Man question

1)
"c"
1
4
2
Returns: {2, 1, 1 }
2)
"b"
4
12
3
Returns: {2, 4, 3 }

[2] return porky;

2)
566
Returns: 56610
The resulting number must be divisible by 5, so it should end either with 0 or with 5. But a
number ending with 5 is odd and can't be divisible by 6. So the last digit of the answer must
be 0. In order to make the number divisible by 6, we need to put something before this 0,
and the smallest appropriate digit is 1.
3)
1000000000
Returns: 1000000000

4)
987654321
Returns: 987654321360

5)
83
Returns: 8304
[3] No time waste Problem

2)
3
Returns: 4
The number of lattice points on the circle of radius 3 is the same as the number of integer
solutions of the equation x^2 + y^2 = 9. Using the formula from the problem statement we
can calculate this number as 4*(d1(9) - d3(9)). It is easy to see that d1(9) = 2 (divisors 1 and
9) and d3(9) = 3 (divisor 3). So the answer is 4*(2 - 1) = 4.
3)
1053
Returns: 12
[5] Guitar serial numbers

2)
{"34H2BJS6N","PIM12MD7RCOLWW09","PYF1J14TF","FIPJOTEA5"}
Returns: {"FIPJOTEA5", "PYF1J14TF", "34H2BJS6N", "PIM12MD7RCOLWW09" }

3)
{"ABCDE", "BCDEF", "ABCDA", "BAAAA", "ACAAA"}
Returns: {"ABCDA", "ABCDE", "ACAAA", "BAAAA", "BCDEF" }
[5] Rot13 Problem( the encryption one)

4)
"NnOoPpQqRr AaBbCcDdEe"
Returns: "AaBbCcDdEe NnOoPpQqRr"
5)
"Gvzr vf 54 71 CZ ba Whyl 4gu bs gur lrne 7558 NQ"
Returns: "Time is 09 26 PM on July 9th of the year 2003 AD"
6)
"Gur dhvpx oebja sbk whzcf bire n ynml qbt"
Returns: "The quick brown fox jumps over a lazy dog"

You might also like