Ad
  • Default User Avatar

    Total average is the average of all valid values:

    discard = 2
    array 0 = 800,1200,2100,4100,1300,700 // discard 800,1200 at start and 1300,700 at end
    array 1 = 1000,1500,4500,5000,5800,2000,1500 // discard 1000,1500 at start and 2000,1500 at end
    
    total avg = (2100 + 4100 + 4500 + 5000 + 5800) / 5
    
  • Default User Avatar

    I have no idea what is happening in random tests and how to debug them.

  • Default User Avatar

    As I understood it [0, 4] are X coordinates and [0, 0] are corresponding Ys.

  • Default User Avatar

    Python

    logistic_map(5,2,[0,4],[0,0])
    #returns
    #[[0,1,2,1,0],
    #[1,2,3,2,1]]
    

    AFAIK Manhattan distance is calculated |x2-x1| + |y2-y1|.

    So at (0,3) with supplys at (0,0) and (4,0) I got:

    |0-0| + |0-3| = 3
    

    and

    |4-0| + |0-3| = 7
    

    But the answer is 1. Did I misunderstand something? TIA.

  • Default User Avatar
      [[64, 63, 3, 4, 5, 6, 58, 57], 
       [56, 55, 11, 12, 13, 14, 50, 49], 
       [17, 18, 46, 45, 44, 43, 23, 24], 
       [25, 26, 38, 37, 36, 35, 31, 32], 
       [33, 34, 30, 29, 28, 27, 39, 40], 
       [41, 42, 22, 21, 20, 19, 47, 48], 
       [16, 15, 51, 52, 53, 54, 10, 9], 
       [8, 7, 59, 60, 61, 62, 2, 1]] 
       
       should equal 
       
       [[64, 2, 3, 61, 60, 6, 7, 57], 
        [9, 55, 54, 12, 13, 51, 50, 16], 
        [17, 47, 46, 20, 21, 43, 42, 24], 
        [40, 26, 27, 37, 36, 30, 31, 33], 
        [32, 34, 35, 29, 28, 38, 39, 25], 
        [41, 23, 22, 44, 45, 19, 18, 48], 
        [49, 15, 14, 52, 53, 11, 10, 56], 
        [8, 58, 59, 5, 4, 62, 63, 1]]
    

    AFAICT that is also a magic square. So why isn't it an acceptable answer?

  • Default User Avatar

    Python,

    Testing for: s=TyTYLX TtEheF xXm MOXruUK bNZU, n=3
    'tyTYLXTtEheFXXMMOXruUKBNZu' should equal 'tytylXTteheFXxMMoxruuKBnzu'
    

    As I understood it:

    TyTYLX  => TyTYLX 
    TtEheF  => TtEheF
    xXm     => XXM
    MOXruUK => MOXruUK
    bNZU    => BNZU
    
    TyTYLXTtEheFXXMMOXruUKBNZU => tyTYLXTtEheFXXMMOXruUKBNZu
    
  • Default User Avatar

    I wanted to do this, but didn't think it would alow so many characters.

  • Default User Avatar

    In Python, fixed tests

    String: 798174707585847782767269738083867178
    Size: 18
    [68, 85] should equal [69, 86]
    
    String: 937175789196798988958481879092738677708380947485827672
    Size: 27
    [69, 95] should equal [70, 96]
    

    I don't understand why those answers are wrong.

  • Default User Avatar

    Python, 4th sample test:

    a = "c611d9bdd9de38b9eb" => "110001100001000111011001101111011101100111011110001110001011100111101011" 
    b = "23a0745505d4d25494" => "1000111010000001110100010101010000010111010100110100100101010010010100"
    

    If we cut from right:

    a = "1100011000010001110110011011110111011001110111100011100010111001111010"
    b = "1000111010000001110100010101010000010111010100110100100101010010010100"
    
    a ^ b = "0100100010010000000010001110100111001110100011010111000111101011101110" =>
    => "1224023a73a35c7aee"
    

    If we cut from the left:

    a = "0001100001000111011001101111011101100111011110001110001011100111101011"
    b = "1000111010000001110100010101010000010111010100110100100101010010010100"
    
    a ^ b = "1001011011000110101101111010001101110000001010111010101110110101111111" =>
    => "25b1ade8dc0aeaed7f"
    

    Expected answer:

     e5b1ade8dc0aeaed7f
    
  • Default User Avatar
  • Default User Avatar
    first_dup('tweet') => 't'
    

    First sample test:

    first_dup('tweet'), 'e'
    
  • Default User Avatar

    "If no word is found, the first character is deemed the longest "word", regardless of its validity".

    Since there are no valid words that start with "e","w","g","s","a" - we add the first character.

    So why in "goodluck" we don't add "o", "d", "u", "c", "k"?

  • Default User Avatar

    I don't understand the first fixed test in java - we're looking for Charlotte Hornets. These are their games:

    Miami Heat 104 Charlotte Hornets 94
    Indiana Pacers 98 Charlotte Hornets 86
    Detroit Pistons 94 Charlotte Hornets 99
    Charlotte Hornets 94 Chicago Bulls 86
    Miami Heat 104 Charlotte Hornets 94
    Indiana Pacers 98 Charlotte Hornets 86
    Detroit Pistons 94 Charlotte Hornets 99
    Charlotte Hornets 94 Chicago Bulls 86
    Miami Heat 104 Charlotte Hornets 94
    Indiana Pacers 98 Charlotte Hornets 86
    Detroit Pistons 94 Charlotte Hornets 99
    Charlotte Hornets 94 Chicago Bulls 86
    

    Total 12 games, but the expected answer is:

     expected:<Charlotte Hornets:W=[2;D=0;L=2;Scored=373;Conceded=382;Points=6]> 
    

    Is there something I misunderstood about the question?

  • Default User Avatar

    I don't understand if double space is a bug or a feature (Java);

    oxENbHBPzPiZmxzUNY WblByPTlKiVnHXPFL Bi hwocVHPmhrMlN gsCAnDKpVwzDMOfsR umzdS G MORSjhDfZH UiyUwqfzvAVYjJPUHr WPyLMOpGJstkmZcnEDl PAAHVGPkzMGypmEQmCz uvWnHrqcTECb fFnolLCEgNpzyVTDJw   Xz JG  wdvynxIjQ TWRGmizeOaX  CKsmhHSkHKFCQEeyQKP bE KQVDetcsQpVCy lszIYLAoCmKmZaVN  goDTj QCCLjtNz XClUiNwtD RSxRYephe SZG QEhyIJnlyROaLZxCrK AiuK XYXlhwcauc OXzPczhnXaIuIguk ZvBIQCStYkSwJhOtbrn V wfZRoLUznNnLjWLCXVm upDIlVsRGJUWaifeMv igVroSfyMKLMGZlZ YSFdiwrnoTOuAohqa SsmFQlYFlwzNPCW jrxQMcbfKkIK wxZwcRyxkEHiE HZAbzJjwDaeJpw Wav hYYZB BVvPSMb UJ Zs
    

    expected:

    <...02wnolLCEgNpzyVTDJF [  88z 74G  119QvynxIjd 84XRGmizeOaW  67PsmhHSkHKFCQEeyQKK 98E 75yVDetcsQpVCQ 108NzIYLAoCmKmZaVs ] 103jDTo 81zCLjtNC 8...>
    

    but was:

    <...02wnolLCEgNpzyVTDJF [88z 74G 119QvynxIjd 84XRGmizeOaW 67PsmhHSkHKFCQEeyQKK 98E 75yVDetcsQpVCQ 108NzIYLAoCmKmZaVs] 103jDTo 81zCLjtNC 8...>
    
  • Default User Avatar

    Could someone explain this to me?

     A valid phone format is +1-xxx-xxx-xxxx
    'Program: Bicycle Author: g964 Phone: +2.003-555-0090 Date: 2019-01-01 Version: 2.0' should equal 
    'Program: Bicycle Author: g964 Phone: +1-503-555-0090 Date: 2019-01-01 Version: 2.0'
    
    'Program: Fan Author: g964 Phone: +6.703-555-0090 Date: 2019-01-01 Version: 6.7' should equal 
    'Program: Fan Author: g964 Phone: +1-503-555-0090 Date: 2019-01-01 Version: 6.7'
    

    '

      versions like 5 are invalid
      'Program: C Author: g964 Phone: +303-555-0090 Date: 2019-01-01 Version: 3' should equal 
      'Program: C Author: g964 Phone: +1-503-555-0090 Date: 2019-01-01 Version: 3'
      
      'Program: H Author: g964 Phone: +603-555-0090 Date: 2019-01-01 Version: 6' should equal 
      'Program: H Author: g964 Phone: +1-503-555-0090 Date: 2019-01-01 Version: 6'
    
  • Loading more items...